(function($){ 'use strict'; if(typeof wpcf7==='undefined'||wpcf7===null){ return; } wpcf7=$.extend({ cached: 0, inputs: [] }, wpcf7); $(function(){ wpcf7.supportHtml5=(function(){ var features={}; var input=document.createElement('input'); features.placeholder='placeholder' in input; var inputTypes=[ 'email', 'url', 'tel', 'number', 'range', 'date' ]; $.each(inputTypes, function(index, value){ input.setAttribute('type', value); features[ value ]=input.type!=='text'; }); return features; })(); $('div.wpcf7 > form').each(function(){ var $form=$(this); wpcf7.initForm($form); if(wpcf7.cached){ wpcf7.refill($form); }}); }); wpcf7.getId=function(form){ return parseInt($('input[name="_wpcf7"]', form).val(), 10); }; wpcf7.initForm=function(form){ var $form=$(form); $form.submit(function(event){ if(! wpcf7.supportHtml5.placeholder){ $('[placeholder].placeheld', $form).each(function(i, n){ $(n).val('').removeClass('placeheld'); }); } if(typeof window.FormData==='function'){ wpcf7.submit($form); event.preventDefault(); }}); $('.wpcf7-submit', $form).after(''); wpcf7.toggleSubmit($form); $form.on('click', '.wpcf7-acceptance', function(){ wpcf7.toggleSubmit($form); }); $('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function(){ var name=$(this).attr('name'); $form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false); }); $('.wpcf7-list-item.has-free-text', $form).each(function(){ var $freetext=$(':input.wpcf7-free-text', this); var $wrap=$(this).closest('.wpcf7-form-control'); if($(':checkbox, :radio', this).is(':checked')){ $freetext.prop('disabled', false); }else{ $freetext.prop('disabled', true); } $wrap.on('change', ':checkbox, :radio', function(){ var $cb=$('.has-free-text', $wrap).find(':checkbox, :radio'); if($cb.is(':checked')){ $freetext.prop('disabled', false).focus(); }else{ $freetext.prop('disabled', true); }}); }); if(! wpcf7.supportHtml5.placeholder){ $('[placeholder]', $form).each(function(){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); $(this).focus(function(){ if($(this).hasClass('placeheld')){ $(this).val('').removeClass('placeheld'); }}); $(this).blur(function(){ if(''===$(this).val()){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); }}); }); } if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.date){ $form.find('input.wpcf7-date[type="date"]').each(function(){ $(this).datepicker({ dateFormat: 'yy-mm-dd', minDate: new Date($(this).attr('min')), maxDate: new Date($(this).attr('max')) }); }); } if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.number){ $form.find('input.wpcf7-number[type="number"]').each(function(){ $(this).spinner({ min: $(this).attr('min'), max: $(this).attr('max'), step: $(this).attr('step') }); }); } $('.wpcf7-character-count', $form).each(function(){ var $count=$(this); var name=$count.attr('data-target-name'); var down=$count.hasClass('down'); var starting=parseInt($count.attr('data-starting-value'), 10); var maximum=parseInt($count.attr('data-maximum-value'), 10); var minimum=parseInt($count.attr('data-minimum-value'), 10); var updateCount=function(target){ var $target=$(target); var length=$target.val().length; var count=down ? starting - length:length; $count.attr('data-current-value', count); $count.text(count); if(maximum&&maximum < length){ $count.addClass('too-long'); }else{ $count.removeClass('too-long'); } if(minimum&&length < minimum){ $count.addClass('too-short'); }else{ $count.removeClass('too-short'); }}; $(':input[name="' + name + '"]', $form).each(function(){ updateCount(this); $(this).keyup(function(){ updateCount(this); }); }); }); $form.on('change', '.wpcf7-validates-as-url', function(){ var val=$.trim($(this).val()); if(val && ! val.match(/^[a-z][a-z0-9.+-]*:/i) && -1!==val.indexOf('.')){ val=val.replace(/^\/+/, ''); val='http://' + val; } $(this).val(val); }); }; wpcf7.submit=function(form){ if(typeof window.FormData!=='function'){ return; } var $form=$(form); $('.ajax-loader', $form).addClass('is-active'); wpcf7.clearResponse($form); var formData=new FormData($form.get(0)); var detail={ id: $form.closest('div.wpcf7').attr('id'), status: 'init', inputs: [], formData: formData }; $.each($form.serializeArray(), function(i, field){ if('_wpcf7'==field.name){ detail.contactFormId=field.value; }else if('_wpcf7_version'==field.name){ detail.pluginVersion=field.value; }else if('_wpcf7_locale'==field.name){ detail.contactFormLocale=field.value; }else if('_wpcf7_unit_tag'==field.name){ detail.unitTag=field.value; }else if('_wpcf7_container_post'==field.name){ detail.containerPostId=field.value; }else if(field.name.match(/^_wpcf7_\w+_free_text_/)){ var owner=field.name.replace(/^_wpcf7_\w+_free_text_/, ''); detail.inputs.push({ name: owner + '-free-text', value: field.value }); }else if(field.name.match(/^_/)){ }else{ detail.inputs.push(field); }}); wpcf7.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail); var ajaxSuccess=function(data, status, xhr, $form){ detail.id=$(data.into).attr('id'); detail.status=data.status; detail.apiResponse=data; var $message=$('.wpcf7-response-output', $form); switch(data.status){ case 'validation_failed': $.each(data.invalidFields, function(i, n){ $(n.into, $form).each(function(){ wpcf7.notValidTip(this, n.message); $('.wpcf7-form-control', this).addClass('wpcf7-not-valid'); $('[aria-invalid]', this).attr('aria-invalid', 'true'); }); }); $message.addClass('wpcf7-validation-errors'); $form.addClass('invalid'); wpcf7.triggerEvent(data.into, 'invalid', detail); break; case 'acceptance_missing': $message.addClass('wpcf7-acceptance-missing'); $form.addClass('unaccepted'); wpcf7.triggerEvent(data.into, 'unaccepted', detail); break; case 'spam': $message.addClass('wpcf7-spam-blocked'); $form.addClass('spam'); wpcf7.triggerEvent(data.into, 'spam', detail); break; case 'aborted': $message.addClass('wpcf7-aborted'); $form.addClass('aborted'); wpcf7.triggerEvent(data.into, 'aborted', detail); break; case 'mail_sent': $message.addClass('wpcf7-mail-sent-ok'); $form.addClass('sent'); wpcf7.triggerEvent(data.into, 'mailsent', detail); break; case 'mail_failed': $message.addClass('wpcf7-mail-sent-ng'); $form.addClass('failed'); wpcf7.triggerEvent(data.into, 'mailfailed', detail); break; default: var customStatusClass='custom-' + data.status.replace(/[^0-9a-z]+/i, '-'); $message.addClass('wpcf7-' + customStatusClass); $form.addClass(customStatusClass); } wpcf7.refill($form, data); wpcf7.triggerEvent(data.into, 'submit', detail); if('mail_sent'==data.status){ $form.each(function(){ this.reset(); }); wpcf7.toggleSubmit($form); } if(! wpcf7.supportHtml5.placeholder){ $form.find('[placeholder].placeheld').each(function(i, n){ $(n).val($(n).attr('placeholder')); }); } $message.html('').append(data.message).slideDown('fast'); $message.attr('role', 'alert'); $('.screen-reader-response', $form.closest('.wpcf7')).each(function(){ var $response=$(this); $response.html('').attr('role', '').append(data.message); if(data.invalidFields){ var $invalids=$(''); $.each(data.invalidFields, function(i, n){ if(n.idref){ var $li=$('
  • ').append($('').attr('href', '#' + n.idref).append(n.message)); }else{ var $li=$('
  • ').append(n.message); } $invalids.append($li); }); $response.append($invalids); } $response.attr('role', 'alert').focus(); }); }; $.ajax({ type: 'POST', url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/feedback'), data: formData, dataType: 'json', processData: false, contentType: false }).done(function(data, status, xhr){ ajaxSuccess(data, status, xhr, $form); $('.ajax-loader', $form).removeClass('is-active'); }).fail(function(xhr, status, error){ var $e=$('
    ').text(error.message); $form.after($e); }); }; wpcf7.triggerEvent=function(target, name, detail){ var $target=$(target); var event=new CustomEvent('wpcf7' + name, { bubbles: true, detail: detail }); $target.get(0).dispatchEvent(event); $target.trigger('wpcf7:' + name, detail); $target.trigger(name + '.wpcf7', detail); }; wpcf7.toggleSubmit=function(form, state){ var $form=$(form); var $submit=$('input:submit', $form); if(typeof state!=='undefined'){ $submit.prop('disabled', ! state); return; } if($form.hasClass('wpcf7-acceptance-as-validation')){ return; } $submit.prop('disabled', false); $('.wpcf7-acceptance', $form).each(function(){ var $span=$(this); var $input=$('input:checkbox', $span); if(! $span.hasClass('optional')){ if($span.hasClass('invert')&&$input.is(':checked') || ! $span.hasClass('invert')&&! $input.is(':checked')){ $submit.prop('disabled', true); return false; }} }); }; wpcf7.notValidTip=function(target, message){ var $target=$(target); $('.wpcf7-not-valid-tip', $target).remove(); $('') .text(message).appendTo($target); if($target.is('.use-floating-validation-tip *')){ var fadeOut=function(target){ $(target).not(':hidden').animate({ opacity: 0 }, 'fast', function(){ $(this).css({ 'z-index': -100 }); }); }; $target.on('mouseover', '.wpcf7-not-valid-tip', function(){ fadeOut(this); }); $target.on('focus', ':input', function(){ fadeOut($('.wpcf7-not-valid-tip', $target)); }); }}; wpcf7.refill=function(form, data){ var $form=$(form); var refillCaptcha=function($form, items){ $.each(items, function(i, n){ $form.find(':input[name="' + i + '"]').val(''); $form.find('img.wpcf7-captcha-' + i).attr('src', n); var match=/([0-9]+)\.(png|gif|jpeg)$/.exec(n); $form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[ 1 ]); }); }; var refillQuiz=function($form, items){ $.each(items, function(i, n){ $form.find(':input[name="' + i + '"]').val(''); $form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[ 0 ]); $form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[ 1 ]); }); }; if(typeof data==='undefined'){ $.ajax({ type: 'GET', url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/refill'), beforeSend: function(xhr){ var nonce=$form.find(':input[name="_wpnonce"]').val(); if(nonce){ xhr.setRequestHeader('X-WP-Nonce', nonce); }}, dataType: 'json' }).done(function(data, status, xhr){ if(data.captcha){ refillCaptcha($form, data.captcha); } if(data.quiz){ refillQuiz($form, data.quiz); }}); }else{ if(data.captcha){ refillCaptcha($form, data.captcha); } if(data.quiz){ refillQuiz($form, data.quiz); }} }; wpcf7.clearResponse=function(form){ var $form=$(form); $form.removeClass('invalid spam sent failed'); $form.siblings('.screen-reader-response').html('').attr('role', ''); $('.wpcf7-not-valid-tip', $form).remove(); $('[aria-invalid]', $form).attr('aria-invalid', 'false'); $('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid'); $('.wpcf7-response-output', $form) .hide().empty().removeAttr('role') .removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked'); }; wpcf7.apiSettings.getRoute=function(path){ var url=wpcf7.apiSettings.root; url=url.replace(wpcf7.apiSettings.namespace, wpcf7.apiSettings.namespace + path); return url; };})(jQuery); (function (){ if(typeof window.CustomEvent==="function") return false; function CustomEvent(event, params){ params=params||{ bubbles: false, cancelable: false, detail: undefined }; var evt=document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype=window.Event.prototype; window.CustomEvent=CustomEvent; })(); (function(a){a.tools=a.tools||{version:"v1.2.7"},a.tools.tabs={conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialEffect:!1,initialIndex:0,event:"click",rotate:!1,slideUpSpeed:400,slideDownSpeed:400,history:!1},addEffect:function(a,c){b[a]=c}};var b={"default":function(a,b){this.getPanes().hide().eq(a).show(),b.call()},fade:function(a,b){var c=this.getConf(),d=c.fadeOutSpeed,e=this.getPanes();d?e.fadeOut(d):e.hide(),e.eq(a).fadeIn(c.fadeInSpeed,b)},slide:function(a,b){var c=this.getConf();this.getPanes().slideUp(c.slideUpSpeed),this.getPanes().eq(a).slideDown(c.slideDownSpeed,b)},ajax:function(a,b){this.getPanes().eq(0).load(this.getTabs().eq(a).attr("href"),b)}},c,d;a.tools.tabs.addEffect("horizontal",function(b,e){if(!c){var f=this.getPanes().eq(b),g=this.getCurrentPane();d||(d=this.getPanes().eq(0).width()),c=!0,f.show(),g.animate({width:0},{step:function(a){f.css("width",d-a)},complete:function(){a(this).hide(),e.call(),c=!1}}),g.length||(e.call(),c=!1)}});function e(c,d,e){var f=this,g=c.add(this),h=c.find(e.tabs),i=d.jquery?d:c.children(d),j;h.length||(h=c.children()),i.length||(i=c.parent().find(d)),i.length||(i=a(d)),a.extend(this,{click:function(d,i){var k=h.eq(d),l=!c.data("tabs");typeof d=="string"&&d.replace("#","")&&(k=h.filter("[href*=\""+d.replace("#","")+"\"]"),d=Math.max(h.index(k),0));if(e.rotate){var m=h.length-1;if(d<0)return f.click(m,i);if(d>m)return f.click(0,i)}if(!k.length){if(j>=0)return f;d=e.initialIndex,k=h.eq(d)}if(d===j)return f;i=i||a.Event(),i.type="onBeforeClick",g.trigger(i,[d]);if(!i.isDefaultPrevented()){var n=l?e.initialEffect&&e.effect||"default":e.effect;b[n].call(f,d,function(){j=d,i.type="onClick",g.trigger(i,[d])}),h.removeClass(e.current),k.addClass(e.current);return f}},getConf:function(){return e},getTabs:function(){return h},getPanes:function(){return i},getCurrentPane:function(){return i.eq(j)},getCurrentTab:function(){return h.eq(j)},getIndex:function(){return j},next:function(){return f.click(j+1)},prev:function(){return f.click(j-1)},destroy:function(){h.off(e.event).removeClass(e.current),i.find("a[href^=\"#\"]").off("click.T");return f}}),a.each("onBeforeClick,onClick".split(","),function(b,c){a.isFunction(e[c])&&a(f).on(c,e[c]),f[c]=function(b){b&&a(f).on(c,b);return f}}),e.history&&a.fn.history&&(a.tools.history.init(h),e.event="history"),h.each(function(b){a(this).on(e.event,function(a){f.click(b,a);return a.preventDefault()})}),i.find("a[href^=\"#\"]").on("click.T",function(b){f.click(a(this).attr("href"),b)}),location.hash&&e.tabs=="a"&&c.find("[href=\""+location.hash+"\"]").length?f.click(location.hash):(e.initialIndex===0||e.initialIndex>0)&&f.click(e.initialIndex)}a.fn.tabs=function(b,c){var d=this.data("tabs");d&&(d.destroy(),this.removeData("tabs")),a.isFunction(c)&&(c={onBeforeClick:c}),c=a.extend({},a.tools.tabs.conf,c),this.each(function(){d=new e(a(this),b,c),a(this).data("tabs",d)});return c.api?d:this}})(jQuery); (function(c){c.extend(c.fn,{validate:function(a){if(this.length){var b=c.data(this[0],"validator");if(b)return b;this.attr("novalidate","novalidate");b=new c.validator(a,this[0]);c.data(this[0],"validator",b);if(b.settings.onsubmit){a=this.find("input, button");a.filter(".cancel").click(function(){b.cancelSubmit=true});b.settings.submitHandler&&a.filter(":submit").click(function(){b.submitButton=this});this.submit(function(d){function e(){if(b.settings.submitHandler){if(b.submitButton)var f=c("").attr("name", b.submitButton.name).val(b.submitButton.value).appendTo(b.currentForm);b.settings.submitHandler.call(b,b.currentForm);b.submitButton&&f.remove();return false}return true}b.settings.debug&&d.preventDefault();if(b.cancelSubmit){b.cancelSubmit=false;return e()}if(b.form()){if(b.pendingRequest){b.formSubmitted=true;return false}return e()}else{b.focusInvalid();return false}})}return b}else a&&a.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing")},valid:function(){if(c(this[0]).is("form"))return this.validate().form(); else{var a=true,b=c(this[0].form).validate();this.each(function(){a&=b.element(this)});return a}},removeAttrs:function(a){var b={},d=this;c.each(a.split(/\s/),function(e,f){b[f]=d.attr(f);d.removeAttr(f)});return b},rules:function(a,b){var d=this[0];if(a){var e=c.data(d.form,"validator").settings,f=e.rules,g=c.validator.staticRules(d);switch(a){case "add":c.extend(g,c.validator.normalizeRule(b));f[d.name]=g;if(b.messages)e.messages[d.name]=c.extend(e.messages[d.name],b.messages);break;case "remove":if(!b){delete f[d.name]; return g}var h={};c.each(b.split(/\s/),function(j,i){h[i]=g[i];delete g[i]});return h}}d=c.validator.normalizeRules(c.extend({},c.validator.metadataRules(d),c.validator.classRules(d),c.validator.attributeRules(d),c.validator.staticRules(d)),d);if(d.required){e=d.required;delete d.required;d=c.extend({required:e},d)}return d}});c.extend(c.expr[":"],{blank:function(a){return!c.trim(""+a.value)},filled:function(a){return!!c.trim(""+a.value)},unchecked:function(a){return!a.checked}});c.validator=function(a, b){this.settings=c.extend(true,{},c.validator.defaults,a);this.currentForm=b;this.init()};c.validator.format=function(a,b){if(arguments.length==1)return function(){var d=c.makeArray(arguments);d.unshift(a);return c.validator.format.apply(this,d)};if(arguments.length>2&&b.constructor!=Array)b=c.makeArray(arguments).slice(1);if(b.constructor!=Array)b=[b];c.each(b,function(d,e){a=a.replace(RegExp("\\{"+d+"\\}","g"),e)});return a};c.extend(c.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error", validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:c([]),errorLabelContainer:c([]),onsubmit:true,ignore:":hidden",ignoreTitle:false,onfocusin:function(a){this.lastActive=a;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass);this.addWrapper(this.errorsFor(a)).hide()}},onfocusout:function(a){if(!this.checkable(a)&&(a.name in this.submitted||!this.optional(a)))this.element(a)}, onkeyup:function(a){if(a.name in this.submitted||a==this.lastElement)this.element(a)},onclick:function(a){if(a.name in this.submitted)this.element(a);else a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(a,b,d){a.type==="radio"?this.findByName(a.name).addClass(b).removeClass(d):c(a).addClass(b).removeClass(d)},unhighlight:function(a,b,d){a.type==="radio"?this.findByName(a.name).removeClass(b).addClass(d):c(a).removeClass(b).addClass(d)}},setDefaults:function(a){c.extend(c.validator.defaults, a)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:c.validator.format("Please enter no more than {0} characters."), minlength:c.validator.format("Please enter at least {0} characters."),rangelength:c.validator.format("Please enter a value between {0} and {1} characters long."),range:c.validator.format("Please enter a value between {0} and {1}."),max:c.validator.format("Please enter a value less than or equal to {0}."),min:c.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){function a(e){var f=c.data(this[0].form,"validator"),g="on"+e.type.replace(/^validate/, "");f.settings[g]&&f.settings[g].call(f,this[0],e)}this.labelContainer=c(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||c(this.currentForm);this.containers=c(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var b=this.groups={};c.each(this.settings.groups,function(e,f){c.each(f.split(/\s/),function(g,h){b[h]=e})});var d= this.settings.rules;c.each(d,function(e,f){d[e]=c.validator.normalizeRule(f)});c(this.currentForm).validateDelegate("[type='text'], [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",a).validateDelegate("[type='radio'], [type='checkbox'], select, option","click", a);this.settings.invalidHandler&&c(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){this.checkForm();c.extend(this.submitted,this.errorMap);this.invalid=c.extend({},this.errorMap);this.valid()||c(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(a){this.lastElement= a=this.validationTargetFor(this.clean(a));this.prepareElement(a);this.currentElements=c(a);var b=this.check(a);if(b)delete this.invalid[a.name];else this.invalid[a.name]=true;if(!this.numberOfInvalids())this.toHide=this.toHide.add(this.containers);this.showErrors();return b},showErrors:function(a){if(a){c.extend(this.errorMap,a);this.errorList=[];for(var b in a)this.errorList.push({message:a[b],element:this.findByName(b)[0]});this.successList=c.grep(this.successList,function(d){return!(d.name in a)})}this.settings.showErrors? this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){c.fn.resetForm&&c(this.currentForm).resetForm();this.submitted={};this.lastElement=null;this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b=0,d;for(d in a)b++;return b},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{c(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(a){}},findLastActive:function(){var a=this.lastActive;return a&&c.grep(this.errorList,function(b){return b.element.name==a.name}).length==1&&a},elements:function(){var a=this,b={};return c(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&& a.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!a.objectLength(c(this).rules()))return false;return b[this.name]=true})},clean:function(a){return c(a)[0]},errors:function(){return c(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=c([]);this.toHide=c([]);this.currentElements=c([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)}, prepareElement:function(a){this.reset();this.toHide=this.errorsFor(a)},check:function(a){a=this.validationTargetFor(this.clean(a));var b=c(a).rules(),d=false,e;for(e in b){var f={method:e,parameters:b[e]};try{var g=c.validator.methods[e].call(this,a.value.replace(/\r/g,""),a,f.parameters);if(g=="dependency-mismatch")d=true;else{d=false;if(g=="pending"){this.toHide=this.toHide.not(this.errorsFor(a));return}if(!g){this.formatAndAdd(a,f);return false}}}catch(h){this.settings.debug&&window.console&&console.log("exception occured when checking element "+ a.id+", check the '"+f.method+"' method",h);throw h;}}if(!d){this.objectLength(b)&&this.successList.push(a);return true}},customMetaMessage:function(a,b){if(c.metadata){var d=this.settings.meta?c(a).metadata()[this.settings.meta]:c(a).metadata();return d&&d.messages&&d.messages[b]}},customMessage:function(a,b){var d=this.settings.messages[a];return d&&(d.constructor==String?d:d[b])},findDefined:function(){for(var a=0;aWarning: No message defined for "+a.name+"")},formatAndAdd:function(a,b){var d=this.defaultMessage(a,b.method),e=/\$?\{(\d+)\}/g;if(typeof d=="function")d=d.call(this,b.parameters,a);else if(e.test(d))d=jQuery.format(d.replace(e,"{$1}"),b.parameters);this.errorList.push({message:d,element:a});this.errorMap[a.name]=d;this.submitted[a.name]= d},addWrapper:function(a){if(this.settings.wrapper)a=a.add(a.parent(this.settings.wrapper));return a},defaultShowErrors:function(){for(var a=0;this.errorList[a];a++){var b=this.errorList[a];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass,this.settings.validClass);this.showLabel(b.element,b.message)}if(this.errorList.length)this.toShow=this.toShow.add(this.containers);if(this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]); if(this.settings.unhighlight){a=0;for(b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass)}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return c(this.errorList).map(function(){return this.element})},showLabel:function(a,b){var d=this.errorsFor(a);if(d.length){d.removeClass(this.settings.validClass).addClass(this.settings.errorClass); d.attr("generated")&&d.html(b)}else{d=c("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(a),generated:true}).addClass(this.settings.errorClass).html(b||"");if(this.settings.wrapper)d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,c(a)):d.insertAfter(a))}if(!b&&this.settings.success){d.text("");typeof this.settings.success=="string"?d.addClass(this.settings.success):this.settings.success(d)}this.toShow= this.toShow.add(d)},errorsFor:function(a){var b=this.idOrName(a);return this.errors().filter(function(){return c(this).attr("for")==b})},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(a){if(this.checkable(a))a=this.findByName(a.name).not(this.settings.ignore)[0];return a},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(a){var b=this.currentForm;return c(document.getElementsByName(a)).map(function(d, e){return e.form==b&&e.name==a&&e||null})},getLength:function(a,b){switch(b.nodeName.toLowerCase()){case "select":return c("option:selected",b).length;case "input":if(this.checkable(b))return this.findByName(b.name).filter(":checked").length}return a.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):true},dependTypes:{"boolean":function(a){return a},string:function(a,b){return!!c(a,b.form).length},"function":function(a,b){return a(b)}},optional:function(a){return!c.validator.methods.required.call(this, c.trim(a.value),a)&&"dependency-mismatch"},startRequest:function(a){if(!this.pending[a.name]){this.pendingRequest++;this.pending[a.name]=true}},stopRequest:function(a,b){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[a.name];if(b&&this.pendingRequest==0&&this.formSubmitted&&this.form()){c(this.currentForm).submit();this.formSubmitted=false}else if(!b&&this.pendingRequest==0&&this.formSubmitted){c(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted= false}},previousValue:function(a){return c.data(a,"previousValue")||c.data(a,"previousValue",{old:null,valid:true,message:this.defaultMessage(a,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(a,b){a.constructor==String?this.classRuleSettings[a]=b:c.extend(this.classRuleSettings, a)},classRules:function(a){var b={};(a=c(a).attr("class"))&&c.each(a.split(" "),function(){this in c.validator.classRuleSettings&&c.extend(b,c.validator.classRuleSettings[this])});return b},attributeRules:function(a){var b={};a=c(a);for(var d in c.validator.methods){var e;if(e=d==="required"&&typeof c.fn.prop==="function"?a.prop(d):a.attr(d))b[d]=e;else if(a[0].getAttribute("type")===d)b[d]=true}b.maxlength&&/-1|2147483647|524288/.test(b.maxlength)&&delete b.maxlength;return b},metadataRules:function(a){if(!c.metadata)return{}; var b=c.data(a.form,"validator").settings.meta;return b?c(a).metadata()[b]:c(a).metadata()},staticRules:function(a){var b={},d=c.data(a.form,"validator");if(d.settings.rules)b=c.validator.normalizeRule(d.settings.rules[a.name])||{};return b},normalizeRules:function(a,b){c.each(a,function(d,e){if(e===false)delete a[d];else if(e.param||e.depends){var f=true;switch(typeof e.depends){case "string":f=!!c(e.depends,b.form).length;break;case "function":f=e.depends.call(b,b)}if(f)a[d]=e.param!==undefined? e.param:true;else delete a[d]}});c.each(a,function(d,e){a[d]=c.isFunction(e)?e(b):e});c.each(["minlength","maxlength","min","max"],function(){if(a[this])a[this]=Number(a[this])});c.each(["rangelength","range"],function(){if(a[this])a[this]=[Number(a[this][0]),Number(a[this][1])]});if(c.validator.autoCreateRanges){if(a.min&&a.max){a.range=[a.min,a.max];delete a.min;delete a.max}if(a.minlength&&a.maxlength){a.rangelength=[a.minlength,a.maxlength];delete a.minlength;delete a.maxlength}}a.messages&&delete a.messages; return a},normalizeRule:function(a){if(typeof a=="string"){var b={};c.each(a.split(/\s/),function(){b[this]=true});a=b}return a},addMethod:function(a,b,d){c.validator.methods[a]=b;c.validator.messages[a]=d!=undefined?d:c.validator.messages[a];b.length<3&&c.validator.addClassRules(a,c.validator.normalizeRule(a))},methods:{required:function(a,b,d){if(!this.depend(d,b))return"dependency-mismatch";switch(b.nodeName.toLowerCase()){case "select":return(a=c(b).val())&&a.length>0;case "input":if(this.checkable(b))return this.getLength(a, b)>0;default:return c.trim(a).length>0}},remote:function(a,b,d){if(this.optional(b))return"dependency-mismatch";var e=this.previousValue(b);this.settings.messages[b.name]||(this.settings.messages[b.name]={});e.originalMessage=this.settings.messages[b.name].remote;this.settings.messages[b.name].remote=e.message;d=typeof d=="string"&&{url:d}||d;if(this.pending[b.name])return"pending";if(e.old===a)return e.valid;e.old=a;var f=this;this.startRequest(b);var g={};g[b.name]=a;c.ajax(c.extend(true,{url:d, mode:"abort",port:"validate"+b.name,dataType:"json",data:g,success:function(h){f.settings.messages[b.name].remote=e.originalMessage;var j=h===true;if(j){var i=f.formSubmitted;f.prepareElement(b);f.formSubmitted=i;f.successList.push(b);f.showErrors()}else{i={};h=h||f.defaultMessage(b,"remote");i[b.name]=e.message=c.isFunction(h)?h(a):h;f.showErrors(i)}e.valid=j;f.stopRequest(b,j)}},d));return"pending"},minlength:function(a,b,d){return this.optional(b)||this.getLength(c.trim(a),b)>=d},maxlength:function(a, b,d){return this.optional(b)||this.getLength(c.trim(a),b)<=d},rangelength:function(a,b,d){a=this.getLength(c.trim(a),b);return this.optional(b)||a>=d[0]&&a<=d[1]},min:function(a,b,d){return this.optional(b)||a>=d},max:function(a,b,d){return this.optional(b)||a<=d},range:function(a,b,d){return this.optional(b)||a>=d[0]&&a<=d[1]},email:function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(a)}, url:function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)}, date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 -]+/.test(a))return false;var d=0,e=0,f=false;a=a.replace(/\D/g,"");for(var g=a.length-1;g>= 0;g--){e=a.charAt(g);e=parseInt(e,10);if(f)if((e*=2)>9)e-=9;d+=e;f=!f}return d%10==0},accept:function(a,b,d){d=typeof d=="string"?d.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(b)||a.match(RegExp(".("+d+")$","i"))},equalTo:function(a,b,d){d=c(d).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){c(b).valid()});return a==d.val()}}});c.format=c.validator.format})(jQuery); (function(c){var a={};if(c.ajaxPrefilter)c.ajaxPrefilter(function(d,e,f){e=d.port;if(d.mode=="abort"){a[e]&&a[e].abort();a[e]=f}});else{var b=c.ajax;c.ajax=function(d){var e=("port"in d?d:c.ajaxSettings).port;if(("mode"in d?d:c.ajaxSettings).mode=="abort"){a[e]&&a[e].abort();return a[e]=b.apply(this,arguments)}return b.apply(this,arguments)}}})(jQuery); (function(c){!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.handle.call(this,e)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)},handler:function(e){arguments[0]=c.event.fix(e);arguments[0].type=b;return c.event.handle.apply(this,arguments)}}});c.extend(c.fn,{validateDelegate:function(a, b,d){return this.bind(b,function(e){var f=c(e.target);if(f.is(a))return d.apply(f,arguments)})}})})(jQuery); ;(function($){$.fn.superfish=function(op){var sf=$.fn.superfish,c=sf.c,$arrow=$([' »'].join('')),over=function(){var $$=$(this),menu=getMenu($$);clearTimeout(menu.sfTimer);$$.showSuperfishUl().siblings().hideSuperfishUl()},out=function(){var $$=$(this),menu=getMenu($$),o=sf.op;clearTimeout(menu.sfTimer);menu.sfTimer=setTimeout(function(){o.retainPath=($.inArray($$[0],o.$path)>-1);$$.hideSuperfishUl();if(o.$path.length&&$$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path)}},o.delay)},getMenu=function($menu){var menu=$menu.parents(['ul.',c.menuClass,':first'].join(''))[0];sf.op=sf.o[menu.serial];return menu},addArrow=function($a){$a.addClass(c.anchorClass).append($arrow.clone())};return this.each(function(){var s=this.serial=sf.o.length;var o=$.extend({},sf.defaults,op);o.$path=$('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){$(this).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass)});sf.o[s]=sf.op=o;$('li:has(ul)',this)[($.fn.hoverIntent&&!o.disableHI)?'hoverIntent':'hover'](over,out).each(function(){if(o.autoArrows)addArrow($('>a:first-child',this))}).not('.'+c.bcClass).hideSuperfishUl();var $a=$('a',this);$a.each(function(i){var $li=$a.eq(i).parents('li');$a.eq(i).focus(function(){over.call($li)}).blur(function(){out.call($li)})});o.onInit.call(this)}).each(function(){var menuClasses=[c.menuClass];if(sf.op.dropShadows&&!($.browser.msie&&$.browser.version<7))menuClasses.push(c.shadowClass);$(this).addClass(menuClasses.join(' '))})};var sf=$.fn.superfish;sf.o=[];sf.op={};sf.IE7fix=function(){var o=sf.op;if($.browser.msie&&$.browser.version>6&&o.dropShadows&&o.animation.opacity!=undefined)this.toggleClass(sf.c.shadowClass+'-off')};sf.c={bcClass:'sf-breadcrumb',menuClass:'sf-js-enabled',anchorClass:'sf-with-ul',arrowClass:'sf-sub-indicator',shadowClass:'sf-shadow'};sf.defaults={hoverClass:'sfHover',pathClass:'overideThisToUse',pathLevels:1,delay:800,animation:{opacity:'show'},speed:'normal',autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){},easing:'swing'};$.fn.extend({hideSuperfishUl:function(){var o=sf.op,not=(o.retainPath===true)?o.$path:'';o.retainPath=false;var $ul=$(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass).find('>ul').hide().css('visibility','hidden');o.onHide.call($ul);return this},showSuperfishUl:function(){var o=sf.op,sh=sf.c.shadowClass+'-off',$ul=this.addClass(o.hoverClass).find('>ul:hidden').css('visibility','visible');sf.IE7fix.call($ul);o.onBeforeShow.call($ul);$ul.animate(o.animation,o.speed,o.easing,function(){sf.IE7fix.call($ul);o.onShow.call($ul)});return this}})})(jQuery); ;(function($){$.fn.supersubs=function(options){var opts=$.extend({},$.fn.supersubs.defaults,options);return this.each(function(){var $$=$(this);var o=$.meta?$.extend({},opts,$$.data()):opts;var fontsize=$('').css({'padding':0,'position':'absolute','top':'-999em','width':'auto'}).appendTo($$).width();$('#menu-fontsize').remove();$ULs=$$.find('ul');$ULs.each(function(i){var $ul=$ULs.eq(i);var $LIs=$ul.children();var $As=$LIs.children('a');var liFloat=$LIs.css('white-space','nowrap').css('float');var emWidth=$ul.add($LIs).add($As).css({'float':'none','width':'auto'}).end().end()[0].clientWidth/fontsize;emWidth+=o.extraWidth;if(emWidth>o.maxWidth){emWidth=o.maxWidth}else if(emWidthul',this);var offsetDirection=$childUl.css('left')!==undefined?'left':'right';$childUl.css(offsetDirection,emWidth)})})})};$.fn.supersubs.defaults={minWidth:9,maxWidth:25,extraWidth:0}})(jQuery); (function($){ $.fn.fitVids=function(options){ var settings={ customSelector: null } var div=document.createElement('div'), ref=document.getElementsByTagName('base')[0]||document.getElementsByTagName('script')[0]; div.className='fit-vids-style'; div.innerHTML='­'; ref.parentNode.insertBefore(div,ref); if(options){ $.extend(settings, options); } return this.each(function(){ var selectors=[ "iframe[src*='player.vimeo.com']", "iframe[src*='www.youtube.com']", "iframe[src*='www.kickstarter.com']", "object", "embed" ]; if(settings.customSelector){ selectors.push(settings.customSelector); } var $allVideos=$(this).find(selectors.join(',')); $allVideos.each(function(){ var $this=$(this); if(this.tagName.toLowerCase()=='embed'&&$this.parent('object').length||$this.parent('.fluid-width-video-wrapper').length){ return; } var height=(this.tagName.toLowerCase()=='object'||$this.attr('height')) ? $this.attr('height'):$this.height(), width=$this.attr('width') ? $this.attr('width'):$this.width(), aspectRatio=height / width; if(!$this.attr('id')){ var videoID='fitvid' + Math.floor(Math.random()*999999); $this.attr('id', videoID); } $this.wrap('
    ').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%"); $this.removeAttr('height').removeAttr('width'); }); }); }})(jQuery); (function(){ var __indexOf=[].indexOf||function(item){ for (var i=0, l=this.length; i < l; i++){ if(i in this&&this[i]===item) return i; } return -1; }, __slice=[].slice; (function(root, factory){ if(typeof define==='function'&&define.amd){ return define('waypoints', ['jquery'], function($){ return factory($, root); }); }else{ return factory(root.jQuery, root); }})(this, function($, window){ var $w, Context, Waypoint, allWaypoints, contextCounter, contextKey, contexts, isTouch, jQMethods, methods, resizeEvent, scrollEvent, waypointCounter, waypointKey, wp, wps; $w=$(window); isTouch=__indexOf.call(window, 'ontouchstart') >=0; allWaypoints={ horizontal: {}, vertical: {}}; contextCounter=1; contexts={}; contextKey='waypoints-context-id'; resizeEvent='resize.waypoints'; scrollEvent='scroll.waypoints'; waypointCounter=1; waypointKey='waypoints-waypoint-ids'; wp='waypoint'; wps='waypoints'; Context=(function(){ function Context($element){ var _this=this; this.$element=$element; this.element=$element[0]; this.didResize=false; this.didScroll=false; this.id='context' + contextCounter++; this.oldScroll={ x: $element.scrollLeft(), y: $element.scrollTop() }; this.waypoints={ horizontal: {}, vertical: {}}; $element.data(contextKey, this.id); contexts[this.id]=this; $element.bind(scrollEvent, function(){ var scrollHandler; if(!(_this.didScroll||isTouch)){ _this.didScroll=true; scrollHandler=function(){ _this.doScroll(); return _this.didScroll=false; }; return window.setTimeout(scrollHandler, $[wps].settings.scrollThrottle); }}); $element.bind(resizeEvent, function(){ var resizeHandler; if(!_this.didResize){ _this.didResize=true; resizeHandler=function(){ $[wps]('refresh'); return _this.didResize=false; }; return window.setTimeout(resizeHandler, $[wps].settings.resizeThrottle); }}); } Context.prototype.doScroll=function(){ var axes, _this=this; axes={ horizontal: { newScroll: this.$element.scrollLeft(), oldScroll: this.oldScroll.x, forward: 'right', backward: 'left' }, vertical: { newScroll: this.$element.scrollTop(), oldScroll: this.oldScroll.y, forward: 'down', backward: 'up' }}; if(isTouch&&(!axes.vertical.oldScroll||!axes.vertical.newScroll)){ $[wps]('refresh'); } $.each(axes, function(aKey, axis){ var direction, isForward, triggered; triggered=[]; isForward=axis.newScroll > axis.oldScroll; direction=isForward ? axis.forward:axis.backward; $.each(_this.waypoints[aKey], function(wKey, waypoint){ var _ref, _ref1; if((axis.oldScroll < (_ref=waypoint.offset)&&_ref <=axis.newScroll)){ return triggered.push(waypoint); }else if((axis.newScroll < (_ref1=waypoint.offset)&&_ref1 <=axis.oldScroll)){ return triggered.push(waypoint); }}); triggered.sort(function(a, b){ return a.offset - b.offset; }); if(!isForward){ triggered.reverse(); } return $.each(triggered, function(i, waypoint){ if(waypoint.options.continuous||i===triggered.length - 1){ return waypoint.trigger([direction]); }}); }); return this.oldScroll={ x: axes.horizontal.newScroll, y: axes.vertical.newScroll };}; Context.prototype.refresh=function(){ var axes, cOffset, isWin, _this=this; isWin=$.isWindow(this.element); cOffset=this.$element.offset(); this.doScroll(); axes={ horizontal: { contextOffset: isWin ? 0:cOffset.left, contextScroll: isWin ? 0:this.oldScroll.x, contextDimension: this.$element.width(), oldScroll: this.oldScroll.x, forward: 'right', backward: 'left', offsetProp: 'left' }, vertical: { contextOffset: isWin ? 0:cOffset.top, contextScroll: isWin ? 0:this.oldScroll.y, contextDimension: isWin ? $[wps]('viewportHeight'):this.$element.height(), oldScroll: this.oldScroll.y, forward: 'down', backward: 'up', offsetProp: 'top' }}; return $.each(axes, function(aKey, axis){ return $.each(_this.waypoints[aKey], function(i, waypoint){ var adjustment, elementOffset, oldOffset, _ref, _ref1; adjustment=waypoint.options.offset; oldOffset=waypoint.offset; elementOffset=$.isWindow(waypoint.element) ? 0:waypoint.$element.offset()[axis.offsetProp]; if($.isFunction(adjustment)){ adjustment=adjustment.apply(waypoint.element); }else if(typeof adjustment==='string'){ adjustment=parseFloat(adjustment); if(waypoint.options.offset.indexOf('%') > -1){ adjustment=Math.ceil(axis.contextDimension * adjustment / 100); }} waypoint.offset=elementOffset - axis.contextOffset + axis.contextScroll - adjustment; if((waypoint.options.onlyOnScroll&&(oldOffset!=null))||!waypoint.enabled){ return; } if(oldOffset!==null&&(oldOffset < (_ref=axis.oldScroll)&&_ref <=waypoint.offset)){ return waypoint.trigger([axis.backward]); }else if(oldOffset!==null&&(oldOffset > (_ref1=axis.oldScroll)&&_ref1 >=waypoint.offset)){ return waypoint.trigger([axis.forward]); }else if(oldOffset===null&&axis.oldScroll >=waypoint.offset){ return waypoint.trigger([axis.forward]); }}); }); }; Context.prototype.checkEmpty=function(){ if($.isEmptyObject(this.waypoints.horizontal)&&$.isEmptyObject(this.waypoints.vertical)){ this.$element.unbind([resizeEvent, scrollEvent].join(' ')); return delete contexts[this.id]; }}; return Context; })(); Waypoint=(function(){ function Waypoint($element, context, options){ var idList, _ref; options=$.extend({}, $.fn[wp].defaults, options); if(options.offset==='bottom-in-view'){ options.offset=function(){ var contextHeight; contextHeight=$[wps]('viewportHeight'); if(!$.isWindow(context.element)){ contextHeight=context.$element.height(); } return contextHeight - $(this).outerHeight(); };} this.$element=$element; this.element=$element[0]; this.axis=options.horizontal ? 'horizontal':'vertical'; this.callback=options.handler; this.context=context; this.enabled=options.enabled; this.id='waypoints' + waypointCounter++; this.offset=null; this.options=options; context.waypoints[this.axis][this.id]=this; allWaypoints[this.axis][this.id]=this; idList=(_ref=$element.data(waypointKey))!=null ? _ref:[]; idList.push(this.id); $element.data(waypointKey, idList); } Waypoint.prototype.trigger=function(args){ if(!this.enabled){ return; } if(this.callback!=null){ this.callback.apply(this.element, args); } if(this.options.triggerOnce){ return this.destroy(); }}; Waypoint.prototype.disable=function(){ return this.enabled=false; }; Waypoint.prototype.enable=function(){ this.context.refresh(); return this.enabled=true; }; Waypoint.prototype.destroy=function(){ delete allWaypoints[this.axis][this.id]; delete this.context.waypoints[this.axis][this.id]; return this.context.checkEmpty(); }; Waypoint.getWaypointsByElement=function(element){ var all, ids; ids=$(element).data(waypointKey); if(!ids){ return []; } all=$.extend({}, allWaypoints.horizontal, allWaypoints.vertical); return $.map(ids, function(id){ return all[id]; }); }; return Waypoint; })(); methods={ init: function(f, options){ var _ref; if(options==null){ options={};} if((_ref=options.handler)==null){ options.handler=f; } this.each(function(){ var $this, context, contextElement, _ref1; $this=$(this); contextElement=(_ref1=options.context)!=null ? _ref1:$.fn[wp].defaults.context; if(!$.isWindow(contextElement)){ contextElement=$this.closest(contextElement); } contextElement=$(contextElement); context=contexts[contextElement.data(contextKey)]; if(!context){ context=new Context(contextElement); } return new Waypoint($this, context, options); }); $[wps]('refresh'); return this; }, disable: function(){ return methods._invoke(this, 'disable'); }, enable: function(){ return methods._invoke(this, 'enable'); }, destroy: function(){ return methods._invoke(this, 'destroy'); }, prev: function(axis, selector){ return methods._traverse.call(this, axis, selector, function(stack, index, waypoints){ if(index > 0){ return stack.push(waypoints[index - 1]); }}); }, next: function(axis, selector){ return methods._traverse.call(this, axis, selector, function(stack, index, waypoints){ if(index < waypoints.length - 1){ return stack.push(waypoints[index + 1]); }}); }, _traverse: function(axis, selector, push){ var stack, waypoints; if(axis==null){ axis='vertical'; } if(selector==null){ selector=window; } waypoints=jQMethods.aggregate(selector); stack=[]; this.each(function(){ var index; index=$.inArray(this, waypoints[axis]); return push(stack, index, waypoints[axis]); }); return this.pushStack(stack); }, _invoke: function($elements, method){ $elements.each(function(){ var waypoints; waypoints=Waypoint.getWaypointsByElement(this); return $.each(waypoints, function(i, waypoint){ waypoint[method](); return true; }); }); return this; }}; $.fn[wp]=function(){ var args, method; method=arguments[0], args=2 <=arguments.length ? __slice.call(arguments, 1):[]; if(methods[method]){ return methods[method].apply(this, args); }else if($.isFunction(method)){ return methods.init.apply(this, arguments); }else if($.isPlainObject(method)){ return methods.init.apply(this, [null, method]); }else if(!method){ return $.error("jQuery Waypoints needs a callback function or handler option."); }else{ return $.error("The " + method + " method does not exist in jQuery Waypoints."); }}; $.fn[wp].defaults={ context: window, continuous: true, enabled: true, horizontal: false, offset: 0, triggerOnce: false }; jQMethods={ refresh: function(){ return $.each(contexts, function(i, context){ return context.refresh(); }); }, viewportHeight: function(){ var _ref; return (_ref=window.innerHeight)!=null ? _ref:$w.height(); }, aggregate: function(contextSelector){ var collection, waypoints, _ref; collection=allWaypoints; if(contextSelector){ collection=(_ref=contexts[$(contextSelector).data(contextKey)])!=null ? _ref.waypoints:void 0; } if(!collection){ return []; } waypoints={ horizontal: [], vertical: [] }; $.each(waypoints, function(axis, arr){ $.each(collection[axis], function(key, waypoint){ return arr.push(waypoint); }); arr.sort(function(a, b){ return a.offset - b.offset; }); waypoints[axis]=$.map(arr, function(waypoint){ return waypoint.element; }); return waypoints[axis]=$.unique(waypoints[axis]); }); return waypoints; }, above: function(contextSelector){ if(contextSelector==null){ contextSelector=window; } return jQMethods._filter(contextSelector, 'vertical', function(context, waypoint){ return waypoint.offset <=context.oldScroll.y; }); }, below: function(contextSelector){ if(contextSelector==null){ contextSelector=window; } return jQMethods._filter(contextSelector, 'vertical', function(context, waypoint){ return waypoint.offset > context.oldScroll.y; }); }, left: function(contextSelector){ if(contextSelector==null){ contextSelector=window; } return jQMethods._filter(contextSelector, 'horizontal', function(context, waypoint){ return waypoint.offset <=context.oldScroll.x; }); }, right: function(contextSelector){ if(contextSelector==null){ contextSelector=window; } return jQMethods._filter(contextSelector, 'horizontal', function(context, waypoint){ return waypoint.offset > context.oldScroll.x; }); }, enable: function(){ return jQMethods._invoke('enable'); }, disable: function(){ return jQMethods._invoke('disable'); }, destroy: function(){ return jQMethods._invoke('destroy'); }, extendFn: function(methodName, f){ return methods[methodName]=f; }, _invoke: function(method){ var waypoints; waypoints=$.extend({}, allWaypoints.vertical, allWaypoints.horizontal); return $.each(waypoints, function(key, waypoint){ waypoint[method](); return true; }); }, _filter: function(selector, axis, test){ var context, waypoints; context=contexts[$(selector).data(contextKey)]; if(!context){ return []; } waypoints=[]; $.each(context.waypoints[axis], function(i, waypoint){ if(test(context, waypoint)){ return waypoints.push(waypoint); }}); waypoints.sort(function(a, b){ return a.offset - b.offset; }); return $.map(waypoints, function(waypoint){ return waypoint.element; }); }}; $[wps]=function(){ var args, method; method=arguments[0], args=2 <=arguments.length ? __slice.call(arguments, 1):[]; if(jQMethods[method]){ return jQMethods[method].apply(null, args); }else{ return jQMethods.aggregate.call(null, method); }}; $[wps].settings={ resizeThrottle: 100, scrollThrottle: 30 }; return $w.load(function(){ return $[wps]('refresh'); }); }); }).call(this); (function(){ (function(root, factory){ if(typeof define==='function'&&define.amd){ return define(['jquery', 'waypoints'], factory); }else{ return factory(root.jQuery); }})(this, function($){ var defaults, wrap; defaults={ wrapper: '
    ', stuckClass: 'stuck' }; wrap=function($elements, options){ $elements.wrap(options.wrapper); $elements.each(function(){ var $this; $this=$(this); $this.parent().height($this.outerHeight()); return true; }); return $elements.parent(); }; return $.waypoints('extendFn', 'sticky', function(options){ var $wrap, originalHandler; options=$.extend({}, $.fn.waypoint.defaults, defaults, options); $wrap=wrap(this, options); originalHandler=options.handler; options.handler=function(direction){ var $sticky, shouldBeStuck; $sticky=$(this).children(':first'); shouldBeStuck=direction==='down'||direction==='right'; $sticky.toggleClass(options.stuckClass, shouldBeStuck); if(originalHandler!=null){ return originalHandler.call(this, direction); }}; $wrap.waypoint(options); return this; }); }); }).call(this); (function(e,t,n,r){function d(t,n){this.element=t,this.options=e.extend({},s,n),this._defaults=s,this._name=i,this.init()}var i="stellar",s={scrollProperty:"scroll",positionProperty:"position",horizontalScrolling:!0,verticalScrolling:!0,horizontalOffset:0,verticalOffset:0,responsive:!1,parallaxBackgrounds:!0,parallaxElements:!0,hideDistantElements:!0,hideElement:function(e){e.hide()},showElement:function(e){e.show()}},o={scroll:{getLeft:function(e){return e.scrollLeft()},setLeft:function(e,t){e.scrollLeft(t)},getTop:function(e){return e.scrollTop()},setTop:function(e,t){e.scrollTop(t)}},position:{getLeft:function(e){return parseInt(e.css("left"),10)*-1},getTop:function(e){return parseInt(e.css("top"),10)*-1}},margin:{getLeft:function(e){return parseInt(e.css("margin-left"),10)*-1},getTop:function(e){return parseInt(e.css("margin-top"),10)*-1}},transform:{getLeft:function(e){var t=getComputedStyle(e[0])[f];return t!=="none"?parseInt(t.match(/(-?[0-9]+)/g)[4],10)*-1:0},getTop:function(e){var t=getComputedStyle(e[0])[f];return t!=="none"?parseInt(t.match(/(-?[0-9]+)/g)[5],10)*-1:0}}},u={position:{setLeft:function(e,t){e.css("left",t)},setTop:function(e,t){e.css("top",t)}},transform:{setPosition:function(e,t,n,r,i){e[0].style[f]="translate3d("+(t-n)+"px, "+(r-i)+"px, 0)"}}},a=function(){var t=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,n=e("script")[0].style,r="",i;for(i in n)if(t.test(i)){r=i.match(t)[0];break}return"WebkitOpacity"in n&&(r="Webkit"),"KhtmlOpacity"in n&&(r="Khtml"),function(e){return r+(r.length>0?e.charAt(0).toUpperCase()+e.slice(1):e)}}(),f=a("transform"),l=e("
    ",{style:"background:#fff"}).css("background-position-x")!==r,c=l?function(e,t,n){e.css({"background-position-x":t,"background-position-y":n})}:function(e,t,n){e.css("background-position",t+" "+n)},h=l?function(e){return[e.css("background-position-x"),e.css("background-position-y")]}:function(e){return e.css("background-position").split(" ")},p=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)};d.prototype={init:function(){this.options.name=i+"_"+Math.floor(Math.random()*1e9),this._defineElements(),this._defineGetters(),this._defineSetters(),this._handleWindowLoadAndResize(),this._detectViewport(),this.refresh({firstLoad:!0}),this.options.scrollProperty==="scroll"?this._handleScrollEvent():this._startAnimationLoop()},_defineElements:function(){this.element===n.body&&(this.element=t),this.$scrollElement=e(this.element),this.$element=this.element===t?e("body"):this.$scrollElement,this.$viewportElement=this.options.viewportElement!==r?e(this.options.viewportElement):this.$scrollElement[0]===t||this.options.scrollProperty==="scroll"?this.$scrollElement:this.$scrollElement.parent()},_defineGetters:function(){var e=this,t=o[e.options.scrollProperty];this._getScrollLeft=function(){return t.getLeft(e.$scrollElement)},this._getScrollTop=function(){return t.getTop(e.$scrollElement)}},_defineSetters:function(){var t=this,n=o[t.options.scrollProperty],r=u[t.options.positionProperty],i=n.setLeft,s=n.setTop;this._setScrollLeft=typeof i=="function"?function(e){i(t.$scrollElement,e)}:e.noop,this._setScrollTop=typeof s=="function"?function(e){s(t.$scrollElement,e)}:e.noop,this._setPosition=r.setPosition||function(e,n,i,s,o){t.options.horizontalScrolling&&r.setLeft(e,n,i),t.options.verticalScrolling&&r.setTop(e,s,o)}},_handleWindowLoadAndResize:function(){var n=this,r=e(t);n.options.responsive&&r.bind("load."+this.name,function(){n.refresh()}),r.bind("resize."+this.name,function(){n._detectViewport(),n.options.responsive&&n.refresh()})},refresh:function(n){var r=this,i=r._getScrollLeft(),s=r._getScrollTop();(!n||!n.firstLoad)&&this._reset(),this._setScrollLeft(0),this._setScrollTop(0),this._setOffsets(),this._findParticles(),this._findBackgrounds(),n&&n.firstLoad&&/WebKit/.test(navigator.userAgent)&&e(t).load(function(){var e=r._getScrollLeft(),t=r._getScrollTop();r._setScrollLeft(e+1),r._setScrollTop(t+1),r._setScrollLeft(e),r._setScrollTop(t)}),this._setScrollLeft(i),this._setScrollTop(s)},_detectViewport:function(){var e=this.$viewportElement.offset(),t=e!==null&&e!==r;this.viewportWidth=this.$viewportElement.width(),this.viewportHeight=this.$viewportElement.height(),this.viewportOffsetTop=t?e.top:0,this.viewportOffsetLeft=t?e.left:0},_findParticles:function(){var t=this,n=this._getScrollLeft(),i=this._getScrollTop();if(this.particles!==r)for(var s=this.particles.length-1;s>=0;s--)this.particles[s].$element.data("stellar-elementIsActive",r);this.particles=[];if(!this.options.parallaxElements)return;this.$element.find("[data-stellar-ratio]").each(function(n){var i=e(this),s,o,u,a,f,l,c,h,p,d=0,v=0,m=0,g=0;if(!i.data("stellar-elementIsActive"))i.data("stellar-elementIsActive",this);else if(i.data("stellar-elementIsActive")!==this)return;t.options.showElement(i),i.data("stellar-startingLeft")?(i.css("left",i.data("stellar-startingLeft")),i.css("top",i.data("stellar-startingTop"))):(i.data("stellar-startingLeft",i.css("left")),i.data("stellar-startingTop",i.css("top"))),u=i.position().left,a=i.position().top,f=i.css("margin-left")==="auto"?0:parseInt(i.css("margin-left"),10),l=i.css("margin-top")==="auto"?0:parseInt(i.css("margin-top"),10),h=i.offset().left-f,p=i.offset().top-l,i.parents().each(function(){var t=e(this);if(t.data("stellar-offset-parent")===!0)return d=m,v=g,c=t,!1;m+=t.position().left,g+=t.position().top}),s=i.data("stellar-horizontal-offset")!==r?i.data("stellar-horizontal-offset"):c!==r&&c.data("stellar-horizontal-offset")!==r?c.data("stellar-horizontal-offset"):t.horizontalOffset,o=i.data("stellar-vertical-offset")!==r?i.data("stellar-vertical-offset"):c!==r&&c.data("stellar-vertical-offset")!==r?c.data("stellar-vertical-offset"):t.verticalOffset,t.particles.push({$element:i,$offsetParent:c,isFixed:i.css("position")==="fixed",horizontalOffset:s,verticalOffset:o,startingPositionLeft:u,startingPositionTop:a,startingOffsetLeft:h,startingOffsetTop:p,parentOffsetLeft:d,parentOffsetTop:v,stellarRatio:i.data("stellar-ratio")!==r?i.data("stellar-ratio"):1,width:i.outerWidth(!0),height:i.outerHeight(!0),isHidden:!1})})},_findBackgrounds:function(){var t=this,n=this._getScrollLeft(),i=this._getScrollTop(),s;this.backgrounds=[];if(!this.options.parallaxBackgrounds)return;s=this.$element.find("[data-stellar-background-ratio]"),this.$element.data("stellar-background-ratio")&&(s=s.add(this.$element)),s.each(function(){var s=e(this),o=h(s),u,a,f,l,p,d,v,m,g,y=0,b=0,w=0,E=0;if(!s.data("stellar-backgroundIsActive"))s.data("stellar-backgroundIsActive",this);else if(s.data("stellar-backgroundIsActive")!==this)return;s.data("stellar-backgroundStartingLeft")?c(s,s.data("stellar-backgroundStartingLeft"),s.data("stellar-backgroundStartingTop")):(s.data("stellar-backgroundStartingLeft",o[0]),s.data("stellar-backgroundStartingTop",o[1])),p=s.css("margin-left")==="auto"?0:parseInt(s.css("margin-left"),10),d=s.css("margin-top")==="auto"?0:parseInt(s.css("margin-top"),10),v=s.offset().left-p-n,m=s.offset().top-d-i,s.parents().each(function(){var t=e(this);if(t.data("stellar-offset-parent")===!0)return y=w,b=E,g=t,!1;w+=t.position().left,E+=t.position().top}),u=s.data("stellar-horizontal-offset")!==r?s.data("stellar-horizontal-offset"):g!==r&&g.data("stellar-horizontal-offset")!==r?g.data("stellar-horizontal-offset"):t.horizontalOffset,a=s.data("stellar-vertical-offset")!==r?s.data("stellar-vertical-offset"):g!==r&&g.data("stellar-vertical-offset")!==r?g.data("stellar-vertical-offset"):t.verticalOffset,t.backgrounds.push({$element:s,$offsetParent:g,isFixed:s.css("background-attachment")==="fixed",horizontalOffset:u,verticalOffset:a,startingValueLeft:o[0],startingValueTop:o[1],startingBackgroundPositionLeft:isNaN(parseInt(o[0],10))?0:parseInt(o[0],10),startingBackgroundPositionTop:isNaN(parseInt(o[1],10))?0:parseInt(o[1],10),startingPositionLeft:s.position().left,startingPositionTop:s.position().top,startingOffsetLeft:v,startingOffsetTop:m,parentOffsetLeft:y,parentOffsetTop:b,stellarRatio:s.data("stellar-background-ratio")===r?1:s.data("stellar-background-ratio")})})},_reset:function(){var e,t,n,r,i;for(i=this.particles.length-1;i>=0;i--)e=this.particles[i],t=e.$element.data("stellar-startingLeft"),n=e.$element.data("stellar-startingTop"),this._setPosition(e.$element,t,t,n,n),this.options.showElement(e.$element),e.$element.data("stellar-startingLeft",null).data("stellar-elementIsActive",null).data("stellar-backgroundIsActive",null);for(i=this.backgrounds.length-1;i>=0;i--)r=this.backgrounds[i],r.$element.data("stellar-backgroundStartingLeft",null).data("stellar-backgroundStartingTop",null),c(r.$element,r.startingValueLeft,r.startingValueTop)},destroy:function(){this._reset(),this.$scrollElement.unbind("resize."+this.name).unbind("scroll."+this.name),this._animationLoop=e.noop,e(t).unbind("load."+this.name).unbind("resize."+this.name)},_setOffsets:function(){var n=this,r=e(t);r.unbind("resize.horizontal-"+this.name).unbind("resize.vertical-"+this.name),typeof this.options.horizontalOffset=="function"?(this.horizontalOffset=this.options.horizontalOffset(),r.bind("resize.horizontal-"+this.name,function(){n.horizontalOffset=n.options.horizontalOffset()})):this.horizontalOffset=this.options.horizontalOffset,typeof this.options.verticalOffset=="function"?(this.verticalOffset=this.options.verticalOffset(),r.bind("resize.vertical-"+this.name,function(){n.verticalOffset=n.options.verticalOffset()})):this.verticalOffset=this.options.verticalOffset},_repositionElements:function(){var e=this._getScrollLeft(),t=this._getScrollTop(),n,r,i,s,o,u,a,f=!0,l=!0,h,p,d,v,m;if(this.currentScrollLeft===e&&this.currentScrollTop===t&&this.currentWidth===this.viewportWidth&&this.currentHeight===this.viewportHeight)return;this.currentScrollLeft=e,this.currentScrollTop=t,this.currentWidth=this.viewportWidth,this.currentHeight=this.viewportHeight;for(m=this.particles.length-1;m>=0;m--)i=this.particles[m],s=i.isFixed?1:0,this.options.horizontalScrolling?(h=(e+i.horizontalOffset+this.viewportOffsetLeft+i.startingPositionLeft-i.startingOffsetLeft+i.parentOffsetLeft)*-(i.stellarRatio+s-1)+i.startingPositionLeft,d=h-i.startingPositionLeft+i.startingOffsetLeft):(h=i.startingPositionLeft,d=i.startingOffsetLeft),this.options.verticalScrolling?(p=(t+i.verticalOffset+this.viewportOffsetTop+i.startingPositionTop-i.startingOffsetTop+i.parentOffsetTop)*-(i.stellarRatio+s-1)+i.startingPositionTop,v=p-i.startingPositionTop+i.startingOffsetTop):(p=i.startingPositionTop,v=i.startingOffsetTop),this.options.hideDistantElements&&(l=!this.options.horizontalScrolling||d+i.width>(i.isFixed?0:e)&&d<(i.isFixed?0:e)+this.viewportWidth+this.viewportOffsetLeft,f=!this.options.verticalScrolling||v+i.height>(i.isFixed?0:t)&&v<(i.isFixed?0:t)+this.viewportHeight+this.viewportOffsetTop),l&&f?(i.isHidden&&(this.options.showElement(i.$element),i.isHidden=!1),this._setPosition(i.$element,h,i.startingPositionLeft,p,i.startingPositionTop)):i.isHidden||(this.options.hideElement(i.$element),i.isHidden=!0);for(m=this.backgrounds.length-1;m>=0;m--)o=this.backgrounds[m],s=o.isFixed?0:1,u=this.options.horizontalScrolling?(e+o.horizontalOffset-this.viewportOffsetLeft-o.startingOffsetLeft+o.parentOffsetLeft-o.startingBackgroundPositionLeft)*(s-o.stellarRatio)+"px":o.startingValueLeft,a=this.options.verticalScrolling?(t+o.verticalOffset-this.viewportOffsetTop-o.startingOffsetTop+o.parentOffsetTop-o.startingBackgroundPositionTop)*(s-o.stellarRatio)+"px":o.startingValueTop,c(o.$element,u,a)},_handleScrollEvent:function(){var e=this,t=!1,n=function(){e._repositionElements(),t=!1},r=function(){t||(p(n),t=!0)};this.$scrollElement.bind("scroll."+this.name,r),r()},_startAnimationLoop:function(){var e=this;this._animationLoop=function(){p(e._animationLoop),e._repositionElements()},this._animationLoop()}},e.fn[i]=function(t){var n=arguments;if(t===r||typeof t=="object")return this.each(function(){e.data(this,"plugin_"+i)||e.data(this,"plugin_"+i,new d(this,t))});if(typeof t=="string"&&t[0]!=="_"&&t!=="init")return this.each(function(){var r=e.data(this,"plugin_"+i);r instanceof d&&typeof r[t]=="function"&&r[t].apply(r,Array.prototype.slice.call(n,1)),t==="destroy"&&e.data(this,"plugin_"+i,null)})},e[i]=function(n){var r=e(t);return r.stellar.apply(r,Array.prototype.slice.call(arguments,0))},e[i].scrollProperty=o,e[i].positionProperty=u,t.Stellar=d})(jQuery,this,document); ;(function ($){ $.flexslider=function(el, options){ var slider=$(el), vars=$.extend({}, $.flexslider.defaults, options), namespace=vars.namespace, touch=("ontouchstart" in window)||window.DocumentTouch&&document instanceof DocumentTouch, eventType=(touch) ? "touchend":"click", vertical=vars.direction==="vertical", reverse=vars.reverse, carousel=(vars.itemWidth > 0), fade=vars.animation==="fade", asNav=vars.asNavFor!=="", methods={}; $.data(el, "flexslider", slider); methods={ init: function(){ slider.animating=false; slider.currentSlide=vars.startAt; slider.animatingTo=slider.currentSlide; slider.atEnd=(slider.currentSlide===0||slider.currentSlide===slider.last); slider.containerSelector=vars.selector.substr(0,vars.selector.search(' ')); slider.slides=$(vars.selector, slider); slider.container=$(slider.containerSelector, slider); slider.count=slider.slides.length; slider.syncExists=$(vars.sync).length > 0; if(vars.animation==="slide") vars.animation="swing"; slider.prop=(vertical) ? "top":"marginLeft"; slider.args={}; slider.manualPause=false; slider.transitions = !vars.video&&!fade&&vars.useCSS&&(function(){ var obj=document.createElement('div'), props=['perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective']; for (var i in props){ if(obj.style[ props[i] ]!==undefined){ slider.pfx=props[i].replace('Perspective','').toLowerCase(); slider.prop="-" + slider.pfx + "-transform"; return true; }} return false; }()); if(vars.controlsContainer!=="") slider.controlsContainer=$(vars.controlsContainer).length > 0&&$(vars.controlsContainer); if(vars.manualControls!=="") slider.manualControls=$(vars.manualControls).length > 0&&$(vars.manualControls); if(vars.randomize){ slider.slides.sort(function(){ return (Math.round(Math.random())-0.5); }); slider.container.empty().append(slider.slides); } slider.doMath(); if(asNav) methods.asNav.setup(); slider.setup("init"); if(vars.controlNav) methods.controlNav.setup(); if(vars.directionNav) methods.directionNav.setup(); if(vars.keyboard&&($(slider.containerSelector).length===1||vars.multipleKeyboard)){ $(document).bind('keyup', function(event){ var keycode=event.keyCode; if(!slider.animating&&(keycode===39||keycode===37)){ var target=(keycode===39) ? slider.getTarget('next') : (keycode===37) ? slider.getTarget('prev'):false; slider.flexAnimate(target, vars.pauseOnAction); }}); } if(vars.mousewheel){ slider.bind('mousewheel', function(event, delta, deltaX, deltaY){ event.preventDefault(); var target=(delta < 0) ? slider.getTarget('next'):slider.getTarget('prev'); slider.flexAnimate(target, vars.pauseOnAction); }); } if(vars.pausePlay) methods.pausePlay.setup(); if(vars.slideshow){ if(vars.pauseOnHover){ slider.hover(function(){ if(!slider.manualPlay&&!slider.manualPause) slider.pause(); }, function(){ if(!slider.manualPause&&!slider.manualPlay) slider.play(); }); } (vars.initDelay > 0) ? setTimeout(slider.play, vars.initDelay):slider.play(); } if(touch&&vars.touch) methods.touch(); if(!fade||(fade&&vars.smoothHeight)) $(window).bind("resize focus", methods.resize); setTimeout(function(){ vars.start(slider); }, 200); }, asNav: { setup: function(){ slider.asNav=true; slider.animatingTo=Math.floor(slider.currentSlide/slider.move); slider.currentItem=slider.currentSlide; slider.slides.removeClass(namespace + "active-slide").eq(slider.currentItem).addClass(namespace + "active-slide"); slider.slides.click(function(e){ e.preventDefault(); var $slide=$(this), target=$slide.index(); if(!$(vars.asNavFor).data('flexslider').animating&&!$slide.hasClass('active')){ slider.direction=(slider.currentItem < target) ? "next":"prev"; slider.flexAnimate(target, vars.pauseOnAction, false, true, true); }}); }}, controlNav: { setup: function(){ if(!slider.manualControls){ methods.controlNav.setupPaging(); }else{ methods.controlNav.setupManual(); }}, setupPaging: function(){ var type=(vars.controlNav==="thumbnails") ? 'control-thumbs':'control-paging', j=1, item; slider.controlNavScaffold=$('
      '); if(slider.pagingCount > 1){ for (var i=0; i < slider.pagingCount; i++){ item=(vars.controlNav==="thumbnails") ? '':'' + j + ''; slider.controlNavScaffold.append('
    1. ' + item + '
    2. '); j++; }} (slider.controlsContainer) ? $(slider.controlsContainer).append(slider.controlNavScaffold):slider.append(slider.controlNavScaffold); methods.controlNav.set(); methods.controlNav.active(); slider.controlNavScaffold.delegate('a, img', eventType, function(event){ event.preventDefault(); var $this=$(this), target=slider.controlNav.index($this); if(!$this.hasClass(namespace + 'active')){ slider.direction=(target > slider.currentSlide) ? "next":"prev"; slider.flexAnimate(target, vars.pauseOnAction); }}); if(touch){ slider.controlNavScaffold.delegate('a', "click touchstart", function(event){ event.preventDefault(); }); }}, setupManual: function(){ slider.controlNav=slider.manualControls; methods.controlNav.active(); slider.controlNav.live(eventType, function(event){ event.preventDefault(); var $this=$(this), target=slider.controlNav.index($this); if(!$this.hasClass(namespace + 'active')){ (target > slider.currentSlide) ? slider.direction="next":slider.direction="prev"; slider.flexAnimate(target, vars.pauseOnAction); }}); if(touch){ slider.controlNav.live("click touchstart", function(event){ event.preventDefault(); }); }}, set: function(){ var selector=(vars.controlNav==="thumbnails") ? 'img':'a'; slider.controlNav=$('.' + namespace + 'control-nav li ' + selector, (slider.controlsContainer) ? slider.controlsContainer:slider); }, active: function(){ slider.controlNav.removeClass(namespace + "active").eq(slider.animatingTo).addClass(namespace + "active"); }, update: function(action, pos){ if(slider.pagingCount > 1&&action==="add"){ slider.controlNavScaffold.append($('
    3. ' + slider.count + '
    4. ')); }else if(slider.pagingCount===1){ slider.controlNavScaffold.find('li').remove(); }else{ slider.controlNav.eq(pos).closest('li').remove(); } methods.controlNav.set(); (slider.pagingCount > 1&&slider.pagingCount!==slider.controlNav.length) ? slider.update(pos, action):methods.controlNav.active(); }}, directionNav: { setup: function(){ var directionNavScaffold=$(''); if(slider.controlsContainer){ $(slider.controlsContainer).append(directionNavScaffold); slider.directionNav=$('.' + namespace + 'direction-nav li a', slider.controlsContainer); }else{ slider.append(directionNavScaffold); slider.directionNav=$('.' + namespace + 'direction-nav li a', slider); } methods.directionNav.update(); slider.directionNav.bind(eventType, function(event){ event.preventDefault(); var target=($(this).hasClass(namespace + 'next')) ? slider.getTarget('next'):slider.getTarget('prev'); slider.flexAnimate(target, vars.pauseOnAction); }); if(touch){ slider.directionNav.bind("click touchstart", function(event){ event.preventDefault(); }); }}, update: function(){ var disabledClass=namespace + 'disabled'; if(slider.pagingCount===1){ slider.directionNav.addClass(disabledClass); }else if(!vars.animationLoop){ if(slider.animatingTo===0){ slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "prev").addClass(disabledClass); }else if(slider.animatingTo===slider.last){ slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "next").addClass(disabledClass); }else{ slider.directionNav.removeClass(disabledClass); }}else{ slider.directionNav.removeClass(disabledClass); }} }, pausePlay: { setup: function(){ var pausePlayScaffold=$('
      '); if(slider.controlsContainer){ slider.controlsContainer.append(pausePlayScaffold); slider.pausePlay=$('.' + namespace + 'pauseplay a', slider.controlsContainer); }else{ slider.append(pausePlayScaffold); slider.pausePlay=$('.' + namespace + 'pauseplay a', slider); } methods.pausePlay.update((vars.slideshow) ? namespace + 'pause':namespace + 'play'); slider.pausePlay.bind(eventType, function(event){ event.preventDefault(); if($(this).hasClass(namespace + 'pause')){ slider.manualPause=true; slider.manualPlay=false; slider.pause(); }else{ slider.manualPause=false; slider.manualPlay=true; slider.play(); }}); if(touch){ slider.pausePlay.bind("click touchstart", function(event){ event.preventDefault(); }); }}, update: function(state){ (state==="play") ? slider.pausePlay.removeClass(namespace + 'pause').addClass(namespace + 'play').text(vars.playText):slider.pausePlay.removeClass(namespace + 'play').addClass(namespace + 'pause').text(vars.pauseText); }}, touch: function(){ var startX, startY, offset, cwidth, dx, startT, scrolling=false; el.addEventListener('touchstart', onTouchStart, false); function onTouchStart(e){ if(slider.animating){ e.preventDefault(); }else if(e.touches.length===1){ slider.pause(); cwidth=(vertical) ? slider.h:slider. w; startT=Number(new Date()); offset=(carousel&&reverse&&slider.animatingTo===slider.last) ? 0 : (carousel&&reverse) ? slider.limit - (((slider.itemW + vars.itemMargin) * slider.move) * slider.animatingTo) : (carousel&&slider.currentSlide===slider.last) ? slider.limit : (carousel) ? ((slider.itemW + vars.itemMargin) * slider.move) * slider.currentSlide : (reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth:(slider.currentSlide + slider.cloneOffset) * cwidth; startX=(vertical) ? e.touches[0].pageY:e.touches[0].pageX; startY=(vertical) ? e.touches[0].pageX:e.touches[0].pageY; el.addEventListener('touchmove', onTouchMove, false); el.addEventListener('touchend', onTouchEnd, false); }} function onTouchMove(e){ dx=(vertical) ? startX - e.touches[0].pageY:startX - e.touches[0].pageX; scrolling=(vertical) ? (Math.abs(dx) < Math.abs(e.touches[0].pageX - startY)):(Math.abs(dx) < Math.abs(e.touches[0].pageY - startY)); if(!scrolling||Number(new Date()) - startT > 500){ e.preventDefault(); if(!fade&&slider.transitions){ if(!vars.animationLoop){ dx=dx/((slider.currentSlide===0&&dx < 0||slider.currentSlide===slider.last&&dx > 0) ? (Math.abs(dx)/cwidth+2):1); } slider.setProps(offset + dx, "setTouch"); }} } function onTouchEnd(e){ el.removeEventListener('touchmove', onTouchMove, false); if(slider.animatingTo===slider.currentSlide&&!scrolling&&!(dx===null)){ var updateDx=(reverse) ? -dx:dx, target=(updateDx > 0) ? slider.getTarget('next'):slider.getTarget('prev'); if(slider.canAdvance(target)&&(Number(new Date()) - startT < 550&&Math.abs(updateDx) > 50||Math.abs(updateDx) > cwidth/2)){ slider.flexAnimate(target, vars.pauseOnAction); }else{ if(!fade) slider.flexAnimate(slider.currentSlide, vars.pauseOnAction, true); }} el.removeEventListener('touchend', onTouchEnd, false); startX=null; startY=null; dx=null; offset=null; }}, resize: function(){ if(!slider.animating&&slider.is(':visible')){ if(!carousel) slider.doMath(); if(fade){ methods.smoothHeight(); }else if(carousel){ slider.slides.width(slider.computedW); slider.update(slider.pagingCount); slider.setProps(); } else if(vertical){ slider.viewport.height(slider.h); slider.setProps(slider.h, "setTotal"); }else{ if(vars.smoothHeight) methods.smoothHeight(); slider.newSlides.width(slider.computedW); slider.setProps(slider.computedW, "setTotal"); }} }, smoothHeight: function(dur){ if(!vertical||fade){ var $obj=(fade) ? slider:slider.viewport; (dur) ? $obj.animate({"height": slider.slides.eq(slider.animatingTo).height()}, dur):$obj.height(slider.slides.eq(slider.animatingTo).height()); }}, sync: function(action){ var $obj=$(vars.sync).data("flexslider"), target=slider.animatingTo; switch (action){ case "animate": $obj.flexAnimate(target, vars.pauseOnAction, false, true); break; case "play": if(!$obj.playing&&!$obj.asNav){ $obj.play(); } break; case "pause": $obj.pause(); break; }} } slider.flexAnimate=function(target, pause, override, withSync, fromNav){ if(asNav&&slider.pagingCount===1) slider.direction=(slider.currentItem < target) ? "next":"prev"; if(!slider.animating&&(slider.canAdvance(target, fromNav)||override)&&slider.is(":visible")){ if(asNav&&withSync){ var master=$(vars.asNavFor).data('flexslider'); slider.atEnd=target===0||target===slider.count - 1; master.flexAnimate(target, true, false, true, fromNav); slider.direction=(slider.currentItem < target) ? "next":"prev"; master.direction=slider.direction; if(Math.ceil((target + 1)/slider.visible) - 1!==slider.currentSlide&&target!==0){ slider.currentItem=target; slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide"); target=Math.floor(target/slider.visible); }else{ slider.currentItem=target; slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide"); return false; }} slider.animating=true; slider.animatingTo=target; vars.before(slider); if(pause) slider.pause(); if(slider.syncExists&&!fromNav) methods.sync("animate"); if(vars.controlNav) methods.controlNav.active(); if(!carousel) slider.slides.removeClass(namespace + 'active-slide').eq(target).addClass(namespace + 'active-slide'); slider.atEnd=target===0||target===slider.last; if(vars.directionNav) methods.directionNav.update(); if(target===slider.last){ vars.end(slider); if(!vars.animationLoop) slider.pause(); } if(!fade){ var dimension=(vertical) ? slider.slides.filter(':first').height():slider.computedW, margin, slideString, calcNext; if(carousel){ margin=(vars.itemWidth > slider.w) ? vars.itemMargin * 2:vars.itemMargin; calcNext=((slider.itemW + margin) * slider.move) * slider.animatingTo; slideString=(calcNext > slider.limit&&slider.visible!==1) ? slider.limit:calcNext; }else if(slider.currentSlide===0&&target===slider.count - 1&&vars.animationLoop&&slider.direction!=="next"){ slideString=(reverse) ? (slider.count + slider.cloneOffset) * dimension:0; }else if(slider.currentSlide===slider.last&&target===0&&vars.animationLoop&&slider.direction!=="prev"){ slideString=(reverse) ? 0:(slider.count + 1) * dimension; }else{ slideString=(reverse) ? ((slider.count - 1) - target + slider.cloneOffset) * dimension:(target + slider.cloneOffset) * dimension; } slider.setProps(slideString, "", vars.animationSpeed); if(slider.transitions){ if(!vars.animationLoop||!slider.atEnd){ slider.animating=false; slider.currentSlide=slider.animatingTo; } slider.container.unbind("webkitTransitionEnd transitionend"); slider.container.bind("webkitTransitionEnd transitionend", function(){ slider.wrapup(dimension); }); }else{ slider.container.animate(slider.args, vars.animationSpeed, vars.easing, function(){ slider.wrapup(dimension); }); }}else{ if(!touch){ slider.slides.eq(slider.currentSlide).fadeOut(vars.animationSpeed, vars.easing); slider.slides.eq(target).fadeIn(vars.animationSpeed, vars.easing, slider.wrapup); }else{ slider.slides.eq(slider.currentSlide).css({ "opacity": 0, "zIndex": 1 }); slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2 }); slider.slides.unbind("webkitTransitionEnd transitionend"); slider.slides.eq(slider.currentSlide).bind("webkitTransitionEnd transitionend", function(){ vars.after(slider); }); slider.animating=false; slider.currentSlide=slider.animatingTo; }} if(vars.smoothHeight) methods.smoothHeight(vars.animationSpeed); }} slider.wrapup=function(dimension){ if(!fade&&!carousel){ if(slider.currentSlide===0&&slider.animatingTo===slider.last&&vars.animationLoop){ slider.setProps(dimension, "jumpEnd"); }else if(slider.currentSlide===slider.last&&slider.animatingTo===0&&vars.animationLoop){ slider.setProps(dimension, "jumpStart"); }} slider.animating=false; slider.currentSlide=slider.animatingTo; vars.after(slider); } slider.animateSlides=function(){ if(!slider.animating) slider.flexAnimate(slider.getTarget("next")); } slider.pause=function(){ clearInterval(slider.animatedSlides); slider.playing=false; if(vars.pausePlay) methods.pausePlay.update("play"); if(slider.syncExists) methods.sync("pause"); } slider.play=function(){ slider.animatedSlides=setInterval(slider.animateSlides, vars.slideshowSpeed); slider.playing=true; if(vars.pausePlay) methods.pausePlay.update("pause"); if(slider.syncExists) methods.sync("play"); } slider.canAdvance=function(target, fromNav){ var last=(asNav) ? slider.pagingCount - 1:slider.last; return (fromNav) ? true : (asNav&&slider.currentItem===slider.count - 1&&target===0&&slider.direction==="prev") ? true : (asNav&&slider.currentItem===0&&target===slider.pagingCount - 1&&slider.direction!=="next") ? false : (target===slider.currentSlide&&!asNav) ? false : (vars.animationLoop) ? true : (slider.atEnd&&slider.currentSlide===0&&target===last&&slider.direction!=="next") ? false : (slider.atEnd&&slider.currentSlide===last&&target===0&&slider.direction==="next") ? false : true; } slider.getTarget=function(dir){ slider.direction=dir; if(dir==="next"){ return (slider.currentSlide===slider.last) ? 0:slider.currentSlide + 1; }else{ return (slider.currentSlide===0) ? slider.last:slider.currentSlide - 1; }} slider.setProps=function(pos, special, dur){ var target=(function(){ var posCheck=(pos) ? pos:((slider.itemW + vars.itemMargin) * slider.move) * slider.animatingTo, posCalc=(function(){ if(carousel){ return (special==="setTouch") ? pos : (reverse&&slider.animatingTo===slider.last) ? 0 : (reverse) ? slider.limit - (((slider.itemW + vars.itemMargin) * slider.move) * slider.animatingTo) : (slider.animatingTo===slider.last) ? slider.limit:posCheck; }else{ switch (special){ case "setTotal": return (reverse) ? ((slider.count - 1) - slider.currentSlide + slider.cloneOffset) * pos:(slider.currentSlide + slider.cloneOffset) * pos; case "setTouch": return (reverse) ? pos:pos; case "jumpEnd": return (reverse) ? pos:slider.count * pos; case "jumpStart": return (reverse) ? slider.count * pos:pos; default: return pos; }} }()); return (posCalc * -1) + "px"; }()); if(slider.transitions){ target=(vertical) ? "translate3d(0," + target + ",0)":"translate3d(" + target + ",0,0)"; dur=(dur!==undefined) ? (dur/1000) + "s":"0s"; slider.container.css("-" + slider.pfx + "-transition-duration", dur); } slider.args[slider.prop]=target; if(slider.transitions||dur===undefined) slider.container.css(slider.args); } slider.setup=function(type){ if(!fade){ var sliderOffset, arr; if(type==="init"){ slider.viewport=$('
      ').css({"overflow": "hidden", "position": "relative"}).appendTo(slider).append(slider.container); slider.cloneCount=0; slider.cloneOffset=0; if(reverse){ arr=$.makeArray(slider.slides).reverse(); slider.slides=$(arr); slider.container.empty().append(slider.slides); }} if(vars.animationLoop&&!carousel){ slider.cloneCount=2; slider.cloneOffset=1; if(type!=="init") slider.container.find('.clone').remove(); slider.container.append(slider.slides.first().clone().addClass('clone')).prepend(slider.slides.last().clone().addClass('clone')); } slider.newSlides=$(vars.selector, slider); sliderOffset=(reverse) ? slider.count - 1 - slider.currentSlide + slider.cloneOffset:slider.currentSlide + slider.cloneOffset; if(vertical&&!carousel){ slider.container.height((slider.count + slider.cloneCount) * 200 + "%").css("position", "absolute").width("100%"); setTimeout(function(){ slider.newSlides.css({"display": "block"}); slider.doMath(); slider.viewport.height(slider.h); slider.setProps(sliderOffset * slider.h, "init"); }, (type==="init") ? 100:0); }else{ slider.container.width((slider.count + slider.cloneCount) * 200 + "%"); slider.setProps(sliderOffset * slider.computedW, "init"); setTimeout(function(){ slider.doMath(); slider.newSlides.css({"width": slider.computedW, "float": "left", "display": "block"}); if(vars.smoothHeight) methods.smoothHeight(); }, (type==="init") ? 100:0); }}else{ slider.slides.css({"width": "100%", "float": "left", "marginRight": "-100%", "position": "relative"}); if(type==="init"){ if(!touch){ slider.slides.eq(slider.currentSlide).fadeIn(vars.animationSpeed, vars.easing); }else{ slider.slides.css({ "opacity": 0, "display": "block", "webkitTransition": "opacity " + vars.animationSpeed / 1000 + "s ease", "zIndex": 1 }).eq(slider.currentSlide).css({ "opacity": 1, "zIndex": 2}); }} if(vars.smoothHeight) methods.smoothHeight(); } if(!carousel) slider.slides.removeClass(namespace + "active-slide").eq(slider.currentSlide).addClass(namespace + "active-slide"); } slider.doMath=function(){ var slide=slider.slides.first(), slideMargin=vars.itemMargin, minItems=vars.minItems, maxItems=vars.maxItems; slider.w=slider.width(); slider.h=slide.height(); slider.boxPadding=slide.outerWidth() - slide.width(); if(carousel){ slider.itemT=vars.itemWidth + slideMargin; slider.minW=(minItems) ? minItems * slider.itemT:slider.w; slider.maxW=(maxItems) ? maxItems * slider.itemT:slider.w; slider.itemW=(slider.minW > slider.w) ? (slider.w - (slideMargin * minItems))/minItems : (slider.maxW < slider.w) ? (slider.w - (slideMargin * maxItems))/maxItems : (vars.itemWidth > slider.w) ? slider.w:vars.itemWidth; slider.visible=Math.floor(slider.w/(slider.itemW + slideMargin)); slider.move=(vars.move > 0&&vars.move < slider.visible) ? vars.move:slider.visible; slider.pagingCount=Math.ceil(((slider.count - slider.visible)/slider.move) + 1); slider.last=slider.pagingCount - 1; slider.limit=(slider.pagingCount===1) ? 0 : (vars.itemWidth > slider.w) ? ((slider.itemW + (slideMargin * 2)) * slider.count) - slider.w - slideMargin:((slider.itemW + slideMargin) * slider.count) - slider.w - slideMargin; }else{ slider.itemW=slider.w; slider.pagingCount=slider.count; slider.last=slider.count - 1; } slider.computedW=slider.itemW - slider.boxPadding; } slider.update=function(pos, action){ slider.doMath(); if(!carousel){ if(pos < slider.currentSlide){ slider.currentSlide +=1; }else if(pos <=slider.currentSlide&&pos!==0){ slider.currentSlide -=1; } slider.animatingTo=slider.currentSlide; } if(vars.controlNav&&!slider.manualControls){ if((action==="add"&&!carousel)||slider.pagingCount > slider.controlNav.length){ methods.controlNav.update("add"); }else if((action==="remove"&&!carousel)||slider.pagingCount < slider.controlNav.length){ if(carousel&&slider.currentSlide > slider.last){ slider.currentSlide -=1; slider.animatingTo -=1; } methods.controlNav.update("remove", slider.last); }} if(vars.directionNav) methods.directionNav.update(); } slider.addSlide=function(obj, pos){ var $obj=$(obj); slider.count +=1; slider.last=slider.count - 1; if(vertical&&reverse){ (pos!==undefined) ? slider.slides.eq(slider.count - pos).after($obj):slider.container.prepend($obj); }else{ (pos!==undefined) ? slider.slides.eq(pos).before($obj):slider.container.append($obj); } slider.update(pos, "add"); slider.slides=$(vars.selector + ':not(.clone)', slider); slider.setup(); vars.added(slider); } slider.removeSlide=function(obj){ var pos=(isNaN(obj)) ? slider.slides.index($(obj)):obj; slider.count -=1; slider.last=slider.count - 1; if(isNaN(obj)){ $(obj, slider.slides).remove(); }else{ (vertical&&reverse) ? slider.slides.eq(slider.last).remove():slider.slides.eq(obj).remove(); } slider.doMath(); slider.update(pos, "remove"); slider.slides=$(vars.selector + ':not(.clone)', slider); slider.setup(); vars.removed(slider); } methods.init(); } $.flexslider.defaults={ namespace: "flex-", selector: ".slides > li", animation: "fade", easing: "swing", direction: "horizontal", reverse: false, animationLoop: true, smoothHeight: false, startAt: 0, slideshow: true, slideshowSpeed: 7000, animationSpeed: 600, initDelay: 0, randomize: false, pauseOnAction: true, pauseOnHover: false, useCSS: true, touch: true, video: false, controlNav: true, directionNav: true, prevText: "Previous", nextText: "Next", keyboard: true, multipleKeyboard: false, mousewheel: false, pausePlay: false, pauseText: "Pause", playText: "Play", controlsContainer: "", manualControls: "", sync: "", asNavFor: "", itemWidth: 0, itemMargin: 0, minItems: 0, maxItems: 0, move: 0, start: function(){}, before: function(){}, after: function(){}, end: function(){}, added: function(){}, removed: function(){}} $.fn.flexslider=function(options){ if(options===undefined) options={}; if(typeof options==="object"){ return this.each(function(){ var $this=$(this), selector=(options.selector) ? options.selector:".slides > li", $slides=$this.find(selector); if($slides.length===1){ $slides.fadeIn(400); if(options.start) options.start($this); }else if($this.data('flexslider')==undefined){ new $.flexslider(this, options); }}); }else{ var $slider=$(this).data('flexslider'); switch (options){ case "play": $slider.play(); break; case "pause": $slider.pause(); break; case "next": $slider.flexAnimate($slider.getTarget("next"), true); break; case "prev": case "previous": $slider.flexAnimate($slider.getTarget("prev"), true); break; default: if(typeof options==="number") $slider.flexAnimate(options, true); }} }})(jQuery); (function(e){var t={},n={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){}};e.fn.bxSlider=function(s){if(0==this.length)return this;if(this.length>1)return this.each(function(){e(this).bxSlider(s)}),this;var o={},r=this;t.el=this;var a=e(window).width(),l=e(window).height(),d=function(){o.settings=e.extend({},n,s),o.settings.slideWidth=parseInt(o.settings.slideWidth),o.children=r.children(o.settings.slideSelector),o.children.length1||o.settings.maxSlides>1,o.carousel&&(o.settings.preloadImages="all"),o.minThreshold=o.settings.minSlides*o.settings.slideWidth+(o.settings.minSlides-1)*o.settings.slideMargin,o.maxThreshold=o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin,o.working=!1,o.controls={},o.interval=null,o.animProp="vertical"==o.settings.mode?"top":"left",o.usingCSS=o.settings.useCSS&&"fade"!=o.settings.mode&&function(){var e=document.createElement("div"),t=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i in t)if(void 0!==e.style[t[i]])return o.cssPrefix=t[i].replace("Perspective","").toLowerCase(),o.animProp="-"+o.cssPrefix+"-transform",!0;return!1}(),"vertical"==o.settings.mode&&(o.settings.maxSlides=o.settings.minSlides),c()},c=function(){if(r.wrap('
      '),o.viewport=r.parent(),o.loader=e('
      '),o.viewport.prepend(o.loader),r.css({width:"horizontal"==o.settings.mode?215*o.children.length+"%":"auto",position:"relative"}),o.usingCSS&&o.settings.easing?r.css("-"+o.cssPrefix+"-transition-timing-function",o.settings.easing):o.settings.easing||(o.settings.easing="swing"),v(),o.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),o.viewport.parent().css({maxWidth:u()}),o.children.css({"float":"horizontal"==o.settings.mode?"left":"none",listStyle:"none",position:"relative"}),o.children.width(p()),"horizontal"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginRight",o.settings.slideMargin),"vertical"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginBottom",o.settings.slideMargin),"fade"==o.settings.mode&&(o.children.css({position:"absolute",zIndex:0,display:"none"}),o.children.eq(o.settings.startSlide).css({zIndex:50,display:"block"})),o.controls.el=e('
      '),o.settings.captions&&E(),o.settings.infiniteLoop&&"fade"!=o.settings.mode&&!o.settings.ticker){var t="vertical"==o.settings.mode?o.settings.minSlides:o.settings.maxSlides,i=o.children.slice(0,t).clone().addClass("bx-clone"),n=o.children.slice(-t).clone().addClass("bx-clone");r.append(i).prepend(n)}o.active.last=o.settings.startSlide==f()-1,o.settings.video&&r.fitVids();var s=o.children.eq(o.settings.startSlide);"all"==o.settings.preloadImages&&(s=r.children()),o.settings.ticker?o.settings.pager=!1:(o.settings.pager&&w(),o.settings.controls&&T(),o.settings.auto&&o.settings.autoControls&&C(),(o.settings.controls||o.settings.autoControls||o.settings.pager)&&o.viewport.after(o.controls.el)),s.imagesLoaded(g)},g=function(){o.loader.remove(),m(),"vertical"==o.settings.mode&&(o.settings.adaptiveHeight=!0),o.viewport.height(h()),r.redrawSlider(),o.settings.onSliderLoad(o.active.index),o.initialized=!0,e(window).bind("resize",Y),o.settings.auto&&o.settings.autoStart&&L(),o.settings.ticker&&W(),o.settings.pager&&M(o.settings.startSlide),o.settings.controls&&D(),o.settings.touchEnabled&&!o.settings.ticker&&O()},h=function(){var t=0,n=e();if("vertical"==o.settings.mode||o.settings.adaptiveHeight)if(o.carousel){var s=1==o.settings.moveSlides?o.active.index:o.active.index*x();for(n=o.children.eq(s),i=1;o.settings.maxSlides-1>=i;i++)n=s+i>=o.children.length?n.add(o.children.eq(i-1)):n.add(o.children.eq(s+i))}else n=o.children.eq(o.active.index);else n=o.children;return"vertical"==o.settings.mode?(n.each(function(){t+=e(this).outerHeight()}),o.settings.slideMargin>0&&(t+=o.settings.slideMargin*(o.settings.minSlides-1))):t=Math.max.apply(Math,n.map(function(){return e(this).outerHeight(!1)}).get()),t},u=function(){var e="100%";return o.settings.slideWidth>0&&(e="horizontal"==o.settings.mode?o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin:o.settings.slideWidth),e},p=function(){var e=o.settings.slideWidth,t=o.viewport.width();return 0==o.settings.slideWidth||o.settings.slideWidth>t&&!o.carousel||"vertical"==o.settings.mode?e=t:o.settings.maxSlides>1&&"horizontal"==o.settings.mode&&(t>o.maxThreshold||o.minThreshold>t&&(e=(t-o.settings.slideMargin*(o.settings.minSlides-1))/o.settings.minSlides)),e},v=function(){var e=1;if("horizontal"==o.settings.mode&&o.settings.slideWidth>0)if(o.viewport.width()o.maxThreshold)e=o.settings.maxSlides;else{var t=o.children.first().width();e=Math.floor(o.viewport.width()/t)}else"vertical"==o.settings.mode&&(e=o.settings.minSlides);return e},f=function(){var e=0;if(o.settings.moveSlides>0)if(o.settings.infiniteLoop)e=o.children.length/x();else for(var t=0,i=0;o.children.length>t;)++e,t=i+v(),i+=o.settings.moveSlides<=v()?o.settings.moveSlides:v();else e=Math.ceil(o.children.length/v());return e},x=function(){return o.settings.moveSlides>0&&o.settings.moveSlides<=v()?o.settings.moveSlides:v()},m=function(){if(o.children.length>o.settings.maxSlides&&o.active.last&&!o.settings.infiniteLoop){if("horizontal"==o.settings.mode){var e=o.children.last(),t=e.position();S(-(t.left-(o.viewport.width()-e.width())),"reset",0)}else if("vertical"==o.settings.mode){var i=o.children.length-o.settings.minSlides,t=o.children.eq(i).position();S(-t.top,"reset",0)}}else{var t=o.children.eq(o.active.index*x()).position();o.active.index==f()-1&&(o.active.last=!0),void 0!=t&&("horizontal"==o.settings.mode?S(-t.left,"reset",0):"vertical"==o.settings.mode&&S(-t.top,"reset",0))}},S=function(e,t,i,n){if(o.usingCSS){var s="vertical"==o.settings.mode?"translate3d(0, "+e+"px, 0)":"translate3d("+e+"px, 0, 0)";r.css("-"+o.cssPrefix+"-transition-duration",i/1e3+"s"),"slide"==t?(r.css(o.animProp,s),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),I()})):"reset"==t?r.css(o.animProp,s):"ticker"==t&&(r.css("-"+o.cssPrefix+"-transition-timing-function","linear"),r.css(o.animProp,s),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),S(n.resetValue,"reset",0),H()}))}else{var a={};a[o.animProp]=e,"slide"==t?r.animate(a,i,o.settings.easing,function(){I()}):"reset"==t?r.css(o.animProp,e):"ticker"==t&&r.animate(a,speed,"linear",function(){S(n.resetValue,"reset",0),H()})}},b=function(){for(var t="",i=f(),n=0;i>n;n++){var s="";o.settings.buildPager&&e.isFunction(o.settings.buildPager)?(s=o.settings.buildPager(n),o.pagerEl.addClass("bx-custom-pager")):(s=n+1,o.pagerEl.addClass("bx-default-pager")),t+='"}o.pagerEl.html(t)},w=function(){o.settings.pagerCustom?o.pagerEl=e(o.settings.pagerCustom):(o.pagerEl=e('
      '),o.settings.pagerSelector?e(o.settings.pagerSelector).html(o.pagerEl):o.controls.el.addClass("bx-has-pager").append(o.pagerEl),b()),o.pagerEl.delegate("a","click",z)},T=function(){o.controls.next=e(''+o.settings.nextText+""),o.controls.prev=e(''+o.settings.prevText+""),o.controls.next.bind("click",A),o.controls.prev.bind("click",P),o.settings.nextSelector&&e(o.settings.nextSelector).append(o.controls.next),o.settings.prevSelector&&e(o.settings.prevSelector).append(o.controls.prev),o.settings.nextSelector||o.settings.prevSelector||(o.controls.directionEl=e('
      '),o.controls.directionEl.append(o.controls.prev).append(o.controls.next),o.controls.el.addClass("bx-has-controls-direction").append(o.controls.directionEl))},C=function(){o.controls.start=e('"),o.controls.stop=e('"),o.controls.autoEl=e('
      '),o.controls.autoEl.delegate(".bx-start","click",k),o.controls.autoEl.delegate(".bx-stop","click",y),o.settings.autoControlsCombine?o.controls.autoEl.append(o.controls.start):o.controls.autoEl.append(o.controls.start).append(o.controls.stop),o.settings.autoControlsSelector?e(o.settings.autoControlsSelector).html(o.controls.autoEl):o.controls.el.addClass("bx-has-controls-auto").append(o.controls.autoEl),q(o.settings.autoStart?"stop":"start")},E=function(){o.children.each(function(){var t=e(this).find("img:first").attr("title");void 0!=t&&e(this).append('
      '+t+"
      ")})},A=function(e){o.settings.auto&&r.stopAuto(),r.goToNextSlide(),e.preventDefault()},P=function(e){o.settings.auto&&r.stopAuto(),r.goToPrevSlide(),e.preventDefault()},k=function(e){r.startAuto(),e.preventDefault()},y=function(e){r.stopAuto(),e.preventDefault()},z=function(t){o.settings.auto&&r.stopAuto();var i=e(t.currentTarget),n=parseInt(i.attr("data-slide-index"));n!=o.active.index&&r.goToSlide(n),t.preventDefault()},M=function(t){return"short"==o.settings.pagerType?(o.pagerEl.html(t+1+o.settings.pagerShortSeparator+o.children.length),void 0):(o.pagerEl.find("a").removeClass("active"),o.pagerEl.each(function(i,n){e(n).find("a").eq(t).addClass("active")}),void 0)},I=function(){if(o.settings.infiniteLoop){var e="";0==o.active.index?e=o.children.eq(0).position():o.active.index==f()-1&&o.carousel?e=o.children.eq((f()-1)*x()).position():o.active.index==o.children.length-1&&(e=o.children.eq(o.children.length-1).position()),"horizontal"==o.settings.mode?S(-e.left,"reset",0):"vertical"==o.settings.mode&&S(-e.top,"reset",0)}o.working=!1,o.settings.onSlideAfter(o.children.eq(o.active.index),o.oldIndex,o.active.index)},q=function(e){o.settings.autoControlsCombine?o.controls.autoEl.html(o.controls[e]):(o.controls.autoEl.find("a").removeClass("active"),o.controls.autoEl.find("a:not(.bx-"+e+")").addClass("active"))},D=function(){1==f()?(o.controls.prev.addClass("disabled"),o.controls.next.addClass("disabled")):!o.settings.infiniteLoop&&o.settings.hideControlOnEnd&&(0==o.active.index?(o.controls.prev.addClass("disabled"),o.controls.next.removeClass("disabled")):o.active.index==f()-1?(o.controls.next.addClass("disabled"),o.controls.prev.removeClass("disabled")):(o.controls.prev.removeClass("disabled"),o.controls.next.removeClass("disabled")))},L=function(){o.settings.autoDelay>0?setTimeout(r.startAuto,o.settings.autoDelay):r.startAuto(),o.settings.autoHover&&r.hover(function(){o.interval&&(r.stopAuto(!0),o.autoPaused=!0)},function(){o.autoPaused&&(r.startAuto(!0),o.autoPaused=null)})},W=function(){var t=0;if("next"==o.settings.autoDirection)r.append(o.children.clone().addClass("bx-clone"));else{r.prepend(o.children.clone().addClass("bx-clone"));var i=o.children.first().position();t="horizontal"==o.settings.mode?-i.left:-i.top}S(t,"reset",0),o.settings.pager=!1,o.settings.controls=!1,o.settings.autoControls=!1,o.settings.tickerHover&&!o.usingCSS&&o.viewport.hover(function(){r.stop()},function(){var t=0;o.children.each(function(){t+="horizontal"==o.settings.mode?e(this).outerWidth(!0):e(this).outerHeight(!0)});var i=o.settings.speed/t,n="horizontal"==o.settings.mode?"left":"top",s=i*(t-Math.abs(parseInt(r.css(n))));H(s)}),H()},H=function(e){speed=e?e:o.settings.speed;var t={left:0,top:0},i={left:0,top:0};"next"==o.settings.autoDirection?t=r.find(".bx-clone").first().position():i=o.children.first().position();var n="horizontal"==o.settings.mode?-t.left:-t.top,s="horizontal"==o.settings.mode?-i.left:-i.top,a={resetValue:s};S(n,"ticker",speed,a)},O=function(){o.touch={start:{x:0,y:0},end:{x:0,y:0}},o.viewport.bind("touchstart",N)},N=function(e){if(o.working)e.preventDefault();else{o.touch.originalPos=r.position();var t=e.originalEvent;o.touch.start.x=t.changedTouches[0].pageX,o.touch.start.y=t.changedTouches[0].pageY,o.viewport.bind("touchmove",B),o.viewport.bind("touchend",X)}},B=function(e){var t=e.originalEvent,i=Math.abs(t.changedTouches[0].pageX-o.touch.start.x),n=Math.abs(t.changedTouches[0].pageY-o.touch.start.y);if(3*i>n&&o.settings.preventDefaultSwipeX?e.preventDefault():3*n>i&&o.settings.preventDefaultSwipeY&&e.preventDefault(),"fade"!=o.settings.mode&&o.settings.oneToOneTouch){var s=0;if("horizontal"==o.settings.mode){var r=t.changedTouches[0].pageX-o.touch.start.x;s=o.touch.originalPos.left+r}else{var r=t.changedTouches[0].pageY-o.touch.start.y;s=o.touch.originalPos.top+r}S(s,"reset",0)}},X=function(e){o.viewport.unbind("touchmove",B);var t=e.originalEvent,i=0;if(o.touch.end.x=t.changedTouches[0].pageX,o.touch.end.y=t.changedTouches[0].pageY,"fade"==o.settings.mode){var n=Math.abs(o.touch.start.x-o.touch.end.x);n>=o.settings.swipeThreshold&&(o.touch.start.x>o.touch.end.x?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto())}else{var n=0;"horizontal"==o.settings.mode?(n=o.touch.end.x-o.touch.start.x,i=o.touch.originalPos.left):(n=o.touch.end.y-o.touch.start.y,i=o.touch.originalPos.top),!o.settings.infiniteLoop&&(0==o.active.index&&n>0||o.active.last&&0>n)?S(i,"reset",200):Math.abs(n)>=o.settings.swipeThreshold?(0>n?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto()):S(i,"reset",200)}o.viewport.unbind("touchend",X)},Y=function(){var t=e(window).width(),i=e(window).height();(a!=t||l!=i)&&(a=t,l=i,r.redrawSlider())};return r.goToSlide=function(t,i){if(!o.working&&o.active.index!=t)if(o.working=!0,o.oldIndex=o.active.index,o.active.index=0>t?f()-1:t>=f()?0:t,o.settings.onSlideBefore(o.children.eq(o.active.index),o.oldIndex,o.active.index),"next"==i?o.settings.onSlideNext(o.children.eq(o.active.index),o.oldIndex,o.active.index):"prev"==i&&o.settings.onSlidePrev(o.children.eq(o.active.index),o.oldIndex,o.active.index),o.active.last=o.active.index>=f()-1,o.settings.pager&&M(o.active.index),o.settings.controls&&D(),"fade"==o.settings.mode)o.settings.adaptiveHeight&&o.viewport.height()!=h()&&o.viewport.animate({height:h()},o.settings.adaptiveHeightSpeed),o.children.filter(":visible").fadeOut(o.settings.speed).css({zIndex:0}),o.children.eq(o.active.index).css("zIndex",51).fadeIn(o.settings.speed,function(){e(this).css("zIndex",50),I()});else{o.settings.adaptiveHeight&&o.viewport.height()!=h()&&o.viewport.animate({height:h()},o.settings.adaptiveHeightSpeed);var n=0,s={left:0,top:0};if(!o.settings.infiniteLoop&&o.carousel&&o.active.last)if("horizontal"==o.settings.mode){var a=o.children.eq(o.children.length-1);s=a.position(),n=o.viewport.width()-a.width()}else{var l=o.children.length-o.settings.minSlides;s=o.children.eq(l).position()}else if(o.carousel&&o.active.last&&"prev"==i){var d=1==o.settings.moveSlides?o.settings.maxSlides-x():(f()-1)*x()-(o.children.length-o.settings.maxSlides),a=r.children(".bx-clone").eq(d);s=a.position()}else if("next"==i&&0==o.active.index)s=r.find("> .bx-clone").eq(o.settings.maxSlides).position(),o.active.last=!1;else if(t>=0){var c=t*x();s=o.children.eq(c).position()}if(s!==void 0){var g="horizontal"==o.settings.mode?-(s.left-n):-s.top;S(g,"slide",o.settings.speed)}}},r.goToNextSlide=function(){if(o.settings.infiniteLoop||!o.active.last){var e=parseInt(o.active.index)+1;r.goToSlide(e,"next")}},r.goToPrevSlide=function(){if(o.settings.infiniteLoop||0!=o.active.index){var e=parseInt(o.active.index)-1;r.goToSlide(e,"prev")}},r.startAuto=function(e){o.interval||(o.interval=setInterval(function(){"next"==o.settings.autoDirection?r.goToNextSlide():r.goToPrevSlide()},o.settings.pause),o.settings.autoControls&&1!=e&&q("stop"))},r.stopAuto=function(e){o.interval&&(clearInterval(o.interval),o.interval=null,o.settings.autoControls&&1!=e&&q("start"))},r.getCurrentSlide=function(){return o.active.index},r.getSlideCount=function(){return o.children.length},r.redrawSlider=function(){o.children.add(r.find(".bx-clone")).width(p()),o.viewport.css("height",h()),o.settings.ticker||m(),o.active.last&&(o.active.index=f()-1),o.active.index>=f()&&(o.active.last=!0),o.settings.pager&&!o.settings.pagerCustom&&(b(),M(o.active.index))},r.destroySlider=function(){o.initialized&&(o.initialized=!1,e(".bx-clone",this).remove(),o.children.removeAttr("style"),this.removeAttr("style").unwrap().unwrap(),o.controls.el&&o.controls.el.remove(),o.controls.next&&o.controls.next.remove(),o.controls.prev&&o.controls.prev.remove(),o.pagerEl&&o.pagerEl.remove(),e(".bx-caption",this).remove(),o.controls.autoEl&&o.controls.autoEl.remove(),clearInterval(o.interval),e(window).unbind("resize",Y))},r.reloadSlider=function(e){void 0!=e&&(s=e),r.destroySlider(),d()},d(),this}})(jQuery),function(e,t){var i="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";e.fn.imagesLoaded=function(n){function s(){var t=e(g),i=e(h);a&&(h.length?a.reject(d,t,i):a.resolve(d)),e.isFunction(n)&&n.call(r,d,t,i)}function o(t,n){t.src===i||-1!==e.inArray(t,c)||(c.push(t),n?h.push(t):g.push(t),e.data(t,"imagesLoaded",{isBroken:n,src:t.src}),l&&a.notifyWith(e(t),[n,d,e(g),e(h)]),d.length===c.length&&(setTimeout(s),d.unbind(".imagesLoaded")))}var r=this,a=e.isFunction(e.Deferred)?e.Deferred():0,l=e.isFunction(a.notify),d=r.find("img").add(r.filter("img")),c=[],g=[],h=[];return e.isPlainObject(n)&&e.each(n,function(e,t){"callback"===e?n=t:a&&a[e](t)}),d.length?d.bind("load.imagesLoaded error.imagesLoaded",function(e){o(e.target,"error"===e.type)}).each(function(n,s){var r=s.src,a=e.data(s,"imagesLoaded");a&&a.src===r?o(s,a.isBroken):s.complete&&s.naturalWidth!==t?o(s,0===s.naturalWidth||0===s.naturalHeight):(s.readyState||s.complete)&&(s.src=i,s.src=r)}):s(),a?a.promise(r):r}}(jQuery); (function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(t){return t.replace(/(:|\.)/g,"\\$1")}var l="1.5.3",o={},n={exclude:[],excludeWithin:[],offset:0,direction:"top",scrollElement:null,scrollTarget:null,beforeScroll:function(){},afterScroll:function(){},easing:"swing",speed:400,autoCoefficient:2,preventDefault:!0},s=function(e){var l=[],o=!1,n=e.dir&&"left"===e.dir?"scrollLeft":"scrollTop";return this.each(function(){if(this!==document&&this!==window){var e=t(this);e[n]()>0?l.push(this):(e[n](1),o=e[n]()>0,o&&l.push(this),e[n](0))}}),l.length||this.each(function(){"BODY"===this.nodeName&&(l=[this])}),"first"===e.el&&l.length>1&&(l=[l[0]]),l};t.fn.extend({scrollable:function(t){var e=s.call(this,{dir:t});return this.pushStack(e)},firstScrollable:function(t){var e=s.call(this,{el:"first",dir:t});return this.pushStack(e)},smoothScroll:function(l,o){if(l=l||{},"options"===l)return o?this.each(function(){var e=t(this),l=t.extend(e.data("ssOpts")||{},o);t(this).data("ssOpts",l)}):this.first().data("ssOpts");var n=t.extend({},t.fn.smoothScroll.defaults,l),s=t.smoothScroll.filterPath(location.pathname);return this.unbind("click.smoothscroll").bind("click.smoothscroll",function(l){var o=this,r=t(this),i=t.extend({},n,r.data("ssOpts")||{}),c=n.exclude,a=i.excludeWithin,f=0,h=0,u=!0,d={},p=location.hostname===o.hostname||!o.hostname,m=i.scrollTarget||t.smoothScroll.filterPath(o.pathname)===s,S=e(o.hash);if(i.scrollTarget||p&&m&&S){for(;u&&c.length>f;)r.is(e(c[f++]))&&(u=!1);for(;u&&a.length>h;)r.closest(a[h++]).length&&(u=!1)}else u=!1;u&&(i.preventDefault&&l.preventDefault(),t.extend(d,i,{scrollTarget:i.scrollTarget||S,link:o}),t.smoothScroll(d))}),this}}),t.smoothScroll=function(e,l){if("options"===e&&"object"==typeof l)return t.extend(o,l);var n,s,r,i,c,a=0,f="offset",h="scrollTop",u={},d={};"number"==typeof e?(n=t.extend({link:null},t.fn.smoothScroll.defaults,o),r=e):(n=t.extend({link:null},t.fn.smoothScroll.defaults,e||{},o),n.scrollElement&&(f="position","static"===n.scrollElement.css("position")&&n.scrollElement.css("position","relative"))),h="left"===n.direction?"scrollLeft":h,n.scrollElement?(s=n.scrollElement,/^(?:HTML|BODY)$/.test(s[0].nodeName)||(a=s[h]())):s=t("html, body").firstScrollable(n.direction),n.beforeScroll.call(s,n),r="number"==typeof e?e:l||t(n.scrollTarget)[f]()&&t(n.scrollTarget)[f]()[n.direction]||0,u[h]=r+a+n.offset,i=n.speed,"auto"===i&&(c=u[h]-s.scrollTop(),0>c&&(c*=-1),i=c/n.autoCoefficient),d={duration:i,easing:n.easing,complete:function(){n.afterScroll.call(n.link,n)}},n.step&&(d.step=n.step),s.length?s.stop().animate(u,d):n.afterScroll.call(n.link,n)},t.smoothScroll.version=l,t.smoothScroll.filterPath=function(t){return t=t||"",t.replace(/^\//,"").replace(/(?:index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")},t.fn.smoothScroll.defaults=n}); !function(e){function t(){var e=location.href;return hashtag=-1!==e.indexOf("#prettyPhoto")?decodeURI(e.substring(e.indexOf("#prettyPhoto")+1,e.length)):!1,hashtag&&(hashtag=hashtag.replace(/<|>/g,"")),hashtag}function i(){"undefined"!=typeof theRel&&(location.hash=theRel+"/"+rel_index+"/")}function p(){-1!==location.href.indexOf("#prettyPhoto")&&(location.hash="prettyPhoto")}function o(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i="[\\?&]"+e+"=([^&#]*)",p=new RegExp(i),o=p.exec(t);return null==o?"":o[1]}e.prettyPhoto={version:"3.1.6"},e.fn.prettyPhoto=function(a){function s(){e(".pp_loaderIcon").hide(),projectedTop=scroll_pos.scrollTop+(I/2-f.containerHeight/2),projectedTop<0&&(projectedTop=0),$ppt.fadeTo(settings.animation_speed,1),$pp_pic_holder.find(".pp_content").animate({height:f.contentHeight,width:f.contentWidth},settings.animation_speed),$pp_pic_holder.animate({top:projectedTop,left:j/2-f.containerWidth/2<0?0:j/2-f.containerWidth/2,width:f.containerWidth},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(f.height).width(f.width),$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed),isSet&&"image"==h(pp_images[set_position])?$pp_pic_holder.find(".pp_hoverContainer").show():$pp_pic_holder.find(".pp_hoverContainer").hide(),settings.allow_expand&&(f.resized?e("a.pp_expand,a.pp_contract").show():e("a.pp_expand").hide()),!settings.autoplay_slideshow||P||v||e.prettyPhoto.startSlideshow(),settings.changepicturecallback(),v=!0}),m(),a.ajaxcallback()}function n(t){$pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden"),$pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed,function(){e(".pp_loaderIcon").show(),t()})}function r(t){t>1?e(".pp_nav").show():e(".pp_nav").hide()}function l(e,t){if(resized=!1,d(e,t),imageWidth=e,imageHeight=t,(k>j||b>I)&&doresize&&settings.allow_resize&&!$){for(resized=!0,fitting=!1;!fitting;)k>j?(imageWidth=j-200,imageHeight=t/e*imageWidth):b>I?(imageHeight=I-200,imageWidth=e/t*imageHeight):fitting=!0,b=imageHeight,k=imageWidth;(k>j||b>I)&&l(k,b),d(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(b),containerWidth:Math.floor(k)+2*settings.horizontal_padding,contentHeight:Math.floor(y),contentWidth:Math.floor(w),resized:resized}}function d(t,i){t=parseFloat(t),i=parseFloat(i),$pp_details=$pp_pic_holder.find(".pp_details"),$pp_details.width(t),detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom")),$pp_details=$pp_details.clone().addClass(settings.theme).width(t).appendTo(e("body")).css({position:"absolute",top:-1e4}),detailsHeight+=$pp_details.height(),detailsHeight=detailsHeight<=34?36:detailsHeight,$pp_details.remove(),$pp_title=$pp_pic_holder.find(".ppt"),$pp_title.width(t),titleHeight=parseFloat($pp_title.css("marginTop"))+parseFloat($pp_title.css("marginBottom")),$pp_title=$pp_title.clone().appendTo(e("body")).css({position:"absolute",top:-1e4}),titleHeight+=$pp_title.height(),$pp_title.remove(),y=i+detailsHeight,w=t,b=y+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height(),k=t}function h(e){return e.match(/youtube\.com\/watch/i)||e.match(/youtu\.be/i)?"youtube":e.match(/vimeo\.com/i)?"vimeo":e.match(/\b.mov\b/i)?"quicktime":e.match(/\b.swf\b/i)?"flash":e.match(/\biframe=true\b/i)?"iframe":e.match(/\bajax=true\b/i)?"ajax":e.match(/\bcustom=true\b/i)?"custom":"#"==e.substr(0,1)?"inline":"image"}function c(){if(doresize&&"undefined"!=typeof $pp_pic_holder){if(scroll_pos=_(),contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width(),projectedTop=I/2+scroll_pos.scrollTop-contentHeight/2,projectedTop<0&&(projectedTop=0),contentHeight>I)return;$pp_pic_holder.css({top:projectedTop,left:j/2+scroll_pos.scrollLeft-contentwidth/2})}}function _(){return self.pageYOffset?{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}:document.documentElement&&document.documentElement.scrollTop?{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}:document.body?{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}:void 0}function g(){I=e(window).height(),j=e(window).width(),"undefined"!=typeof $pp_overlay&&$pp_overlay.height(e(document).height()).width(j)}function m(){isSet&&settings.overlay_gallery&&"image"==h(pp_images[set_position])?(itemWidth=57,navWidth="facebook"==settings.theme||"pp_default"==settings.theme?50:30,itemsPerPage=Math.floor((f.containerWidth-100-navWidth)/itemWidth),itemsPerPage=itemsPerPage";toInject=settings.gallery_markup.replace(/{gallery}/g,toInject),$pp_pic_holder.find("#pp_full_res").after(toInject),$pp_gallery=e(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li"),$pp_gallery.find(".pp_arrow_next").click(function(){return e.prettyPhoto.changeGalleryPage("next"),e.prettyPhoto.stopSlideshow(),!1}),$pp_gallery.find(".pp_arrow_previous").click(function(){return e.prettyPhoto.changeGalleryPage("previous"),e.prettyPhoto.stopSlideshow(),!1}),$pp_pic_holder.find(".pp_content").hover(function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()},function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()}),itemWidth=57,$pp_gallery_li.each(function(t){e(this).find("a").click(function(){return e.prettyPhoto.changePage(t),e.prettyPhoto.stopSlideshow(),!1})})}settings.slideshow&&($pp_pic_holder.find(".pp_nav").prepend('Play'),$pp_pic_holder.find(".pp_nav .pp_play").click(function(){return e.prettyPhoto.startSlideshow(),!1})),$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme),$pp_overlay.css({opacity:0,height:e(document).height(),width:e(window).width()}).bind("click",function(){settings.modal||e.prettyPhoto.close()}),e("a.pp_close").bind("click",function(){return e.prettyPhoto.close(),!1}),settings.allow_expand&&e("a.pp_expand").bind("click",function(){return e(this).hasClass("pp_expand")?(e(this).removeClass("pp_expand").addClass("pp_contract"),doresize=!1):(e(this).removeClass("pp_contract").addClass("pp_expand"),doresize=!0),n(function(){e.prettyPhoto.open()}),!1}),$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){return e.prettyPhoto.changePage("previous"),e.prettyPhoto.stopSlideshow(),!1}),$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){return e.prettyPhoto.changePage("next"),e.prettyPhoto.stopSlideshow(),!1}),c()}a=jQuery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:!1,opacity:.8,show_title:!0,allow_resize:!0,allow_expand:!0,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:!1,wmode:"opaque",autoplay:!0,modal:!1,deeplinking:!0,overlay_gallery:!0,overlay_gallery_max:30,keyboard_shortcuts:!0,changepicturecallback:function(){},callback:function(){},ie6_fallback:!0,markup:'
       
      ',gallery_markup:'',image_markup:'',flash_markup:'',quicktime_markup:'',iframe_markup:'',inline_markup:'
      {content}
      ',custom_markup:"",social_tools:''},a);var f,v,y,w,b,k,P,x=this,$=!1,I=e(window).height(),j=e(window).width();return doresize=!0,scroll_pos=_(),e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){c(),g()}),a.keyboard_shortcuts&&e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(t){if("undefined"!=typeof $pp_pic_holder&&$pp_pic_holder.is(":visible"))switch(t.keyCode){case 37:e.prettyPhoto.changePage("previous"),t.preventDefault();break;case 39:e.prettyPhoto.changePage("next"),t.preventDefault();break;case 27:settings.modal||e.prettyPhoto.close(),t.preventDefault()}}),e.prettyPhoto.initialize=function(){return settings=a,"pp_default"==settings.theme&&(settings.horizontal_padding=16),theRel=e(this).attr(settings.hook),galleryRegExp=/\[(?:.*)\]/,isSet=galleryRegExp.exec(theRel)?!0:!1,pp_images=isSet?jQuery.map(x,function(t){return-1!=e(t).attr(settings.hook).indexOf(theRel)?e(t).attr("href"):void 0}):e.makeArray(e(this).attr("href")),pp_titles=isSet?jQuery.map(x,function(t){return-1!=e(t).attr(settings.hook).indexOf(theRel)?e(t).find("img").attr("alt")?e(t).find("img").attr("alt"):"":void 0}):e.makeArray(e(this).find("img").attr("alt")),pp_descriptions=isSet?jQuery.map(x,function(t){return-1!=e(t).attr(settings.hook).indexOf(theRel)?e(t).attr("title")?e(t).attr("title"):"":void 0}):e.makeArray(e(this).attr("title")),pp_images.length>settings.overlay_gallery_max&&(settings.overlay_gallery=!1),set_position=jQuery.inArray(e(this).attr("href"),pp_images),rel_index=isSet?set_position:e("a["+settings.hook+"^='"+theRel+"']").index(e(this)),u(this),settings.allow_resize&&e(window).bind("scroll.prettyphoto",function(){c()}),e.prettyPhoto.open(),!1},e.prettyPhoto.open=function(t){return"undefined"==typeof settings&&(settings=a,pp_images=e.makeArray(arguments[0]),pp_titles=e.makeArray(arguments[1]?arguments[1]:""),pp_descriptions=e.makeArray(arguments[2]?arguments[2]:""),isSet=pp_images.length>1?!0:!1,set_position=arguments[3]?arguments[3]:0,u(t.target)),settings.hideflash&&e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden"),r(e(pp_images).size()),e(".pp_loaderIcon").show(),settings.deeplinking&&i(),settings.social_tools&&(facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href)),$pp_pic_holder.find(".pp_social").html(facebook_like_link)),$ppt.is(":hidden")&&$ppt.css("opacity",0).show(),$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity),$pp_pic_holder.find(".currentTextHolder").text(set_position+1+settings.counter_separator_label+e(pp_images).size()),"undefined"!=typeof pp_descriptions[set_position]&&""!=pp_descriptions[set_position]?$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position])):$pp_pic_holder.find(".pp_description").hide(),movie_width=parseFloat(o("width",pp_images[set_position]))?o("width",pp_images[set_position]):settings.default_width.toString(),movie_height=parseFloat(o("height",pp_images[set_position]))?o("height",pp_images[set_position]):settings.default_height.toString(),$=!1,-1!=movie_height.indexOf("%")&&(movie_height=parseFloat(e(window).height()*parseFloat(movie_height)/100-150),$=!0),-1!=movie_width.indexOf("%")&&(movie_width=parseFloat(e(window).width()*parseFloat(movie_width)/100-150),$=!0),$pp_pic_holder.fadeIn(function(){switch($ppt.html(settings.show_title&&""!=pp_titles[set_position]&&"undefined"!=typeof pp_titles[set_position]?unescape(pp_titles[set_position]):" "),imgPreloader="",skipInjection=!1,h(pp_images[set_position])){case"image":imgPreloader=new Image,nextImage=new Image,isSet&&set_position0&&(movie_id=movie_id.substr(0,movie_id.indexOf("?"))),movie_id.indexOf("&")>0&&(movie_id=movie_id.substr(0,movie_id.indexOf("&")))),movie="http://www.youtube.com/embed/"+movie_id,movie+=o("rel",pp_images[set_position])?"?rel="+o("rel",pp_images[set_position]):"?rel=1",settings.autoplay&&(movie+="&autoplay=1"),toInject=settings.iframe_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":f=l(movie_width,movie_height),movie_id=pp_images[set_position];var t=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/,i=movie_id.match(t);movie="http://player.vimeo.com/video/"+i[3]+"?title=0&byline=0&portrait=0",settings.autoplay&&(movie+="&autoplay=1;"),vimeo_width=f.width+"/embed/?moog_width="+f.width,toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,f.height).replace(/{path}/g,movie);break;case"quicktime":f=l(movie_width,movie_height),f.height+=15,f.contentHeight+=15,f.containerHeight+=15,toInject=settings.quicktime_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":f=l(movie_width,movie_height),flash_vars=pp_images[set_position],flash_vars=flash_vars.substring(pp_images[set_position].indexOf("flashvars")+10,pp_images[set_position].length),filename=pp_images[set_position],filename=filename.substring(0,filename.indexOf("?")),toInject=settings.flash_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":f=l(movie_width,movie_height),frame_url=pp_images[set_position],frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1),toInject=settings.iframe_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{path}/g,frame_url);break;case"ajax":doresize=!1,f=l(movie_width,movie_height),doresize=!0,skipInjection=!0,e.get(pp_images[set_position],function(e){toInject=settings.inline_markup.replace(/{content}/g,e),$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject,s()});break;case"custom":f=l(movie_width,movie_height),toInject=settings.custom_markup;break;case"inline":myClone=e(pp_images[set_position]).clone().append('
      ').css({width:settings.default_width}).wrapInner('
      ').appendTo(e("body")).show(),doresize=!1,f=l(e(myClone).width(),e(myClone).height()),doresize=!0,e(myClone).remove(),toInject=settings.inline_markup.replace(/{content}/g,e(pp_images[set_position]).html())}imgPreloader||skipInjection||($pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject,s())}),!1},e.prettyPhoto.changePage=function(t){currentGalleryPage=0,"previous"==t?(set_position--,set_position<0&&(set_position=e(pp_images).size()-1)):"next"==t?(set_position++,set_position>e(pp_images).size()-1&&(set_position=0)):set_position=t,rel_index=set_position,doresize||(doresize=!0),settings.allow_expand&&e(".pp_contract").removeClass("pp_contract").addClass("pp_expand"),n(function(){e.prettyPhoto.open()})},e.prettyPhoto.changeGalleryPage=function(e){"next"==e?(currentGalleryPage++,currentGalleryPage>totalPage&&(currentGalleryPage=0)):"previous"==e?(currentGalleryPage--,currentGalleryPage<0&&(currentGalleryPage=totalPage)):currentGalleryPage=e,slide_speed="next"==e||"previous"==e?settings.animation_speed:0,slide_to=currentGalleryPage*itemsPerPage*itemWidth,$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)},e.prettyPhoto.startSlideshow=function(){"undefined"==typeof P?($pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){return e.prettyPhoto.stopSlideshow(),!1}),P=setInterval(e.prettyPhoto.startSlideshow,settings.slideshow)):e.prettyPhoto.changePage("next")},e.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function(){return e.prettyPhoto.startSlideshow(),!1}),clearInterval(P),P=void 0},e.prettyPhoto.close=function(){$pp_overlay.is(":animated")||(e.prettyPhoto.stopSlideshow(),$pp_pic_holder.stop().find("object,embed").css("visibility","hidden"),e("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){e(this).remove()}),$pp_overlay.fadeOut(settings.animation_speed,function(){settings.hideflash&&e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible"),e(this).remove(),e(window).unbind("scroll.prettyphoto"),p(),settings.callback(),doresize=!0,v=!1,delete settings}))},!pp_alreadyInitialized&&t()&&(pp_alreadyInitialized=!0,hashIndex=t(),hashRel=hashIndex,hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1),hashRel=hashRel.substring(0,hashRel.indexOf("/")),setTimeout(function(){e("a["+a.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50)),this.unbind("click.prettyphoto").bind("click.prettyphoto",e.prettyPhoto.initialize)}}(jQuery);var pp_alreadyInitialized=!1; (function(a,b,c){"use strict";var d=a.document,e=a.Modernizr,f=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},g="Moz Webkit O Ms".split(" "),h=function(a){var b=d.documentElement.style,c;if(typeof b[a]=="string")return a;a=f(a);for(var e=0,h=g.length;e"+d+"{#modernizr{height:3px}}"+"").appendTo("head"),f=b('
      ').appendTo("html");a=f.height()===3,f.remove(),e.remove()}return a},csstransitions:function(){return!!j}},l;if(e)for(l in k)e.hasOwnProperty(l)||e.addTest(l,k[l]);else{e=a.Modernizr={_version:"1.6ish: miniModernizr for Isotope"};var m=" ",n;for(l in k)n=k[l](),e[l]=n,m+=" "+(n?"":"no-")+l;b("html").addClass(m)}if(e.csstransforms){var o=e.csstransforms3d?{translate:function(a){return"translate3d("+a[0]+"px, "+a[1]+"px, 0) "},scale:function(a){return"scale3d("+a+", "+a+", 1) "}}:{translate:function(a){return"translate("+a[0]+"px, "+a[1]+"px) "},scale:function(a){return"scale("+a+") "}},p=function(a,c,d){var e=b.data(a,"isoTransform")||{},f={},g,h={},j;f[c]=d,b.extend(e,f);for(g in e)j=e[g],h[g]=o[g](j);var k=h.translate||"",l=h.scale||"",m=k+l;b.data(a,"isoTransform",e),a.style[i]=m};b.cssNumber.scale=!0,b.cssHooks.scale={set:function(a,b){p(a,"scale",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.scale?d.scale:1}},b.fx.step.scale=function(a){b.cssHooks.scale.set(a.elem,a.now+a.unit)},b.cssNumber.translate=!0,b.cssHooks.translate={set:function(a,b){p(a,"translate",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.translate?d.translate:[0,0]}}}var q,r;e.csstransitions&&(q={WebkitTransitionProperty:"webkitTransitionEnd",MozTransitionProperty:"transitionend",OTransitionProperty:"oTransitionEnd",transitionProperty:"transitionEnd"}[j],r=h("transitionDuration"));var s=b.event,t;s.special.smartresize={setup:function(){b(this).bind("resize",s.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",s.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",t&&clearTimeout(t),t=setTimeout(function(){jQuery.event.handle.apply(c,d)},b==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Isotope=function(a,c,d){this.element=b(c),this._create(a),this._init(d)};var u=["width","height"],v=b(a);b.Isotope.settings={resizable:!0,layoutMode:"masonry",containerClass:"isotope",itemClass:"isotope-item",hiddenClass:"isotope-hidden",hiddenStyle:{opacity:0,scale:.001},visibleStyle:{opacity:1,scale:1},containerStyle:{position:"relative",overflow:"hidden"},animationEngine:"best-available",animationOptions:{queue:!1,duration:800},sortBy:"original-order",sortAscending:!0,resizesContainer:!0,transformsEnabled:!b.browser.opera,itemPositionDataEnabled:!1},b.Isotope.prototype={_create:function(a){this.options=b.extend({},b.Isotope.settings,a),this.styleQueue=[],this.elemCount=0;var c=this.element[0].style;this.originalStyle={};var d=u.slice(0);for(var e in this.options.containerStyle)d.push(e);for(var f=0,g=d.length;fg?1:f0&&(i=function(a,b){b.$el[d](b.style,f).one(q,k)},j=!1)}}b.each(this.styleQueue,i),j&&k(),this.styleQueue=[]},resize:function(){this["_"+this.options.layoutMode+"ResizeChanged"]()&&this.reLayout()},reLayout:function(a){this["_"+this.options.layoutMode+"Reset"](),this.layout(this.$filteredAtoms,a)},addItems:function(a,b){var c=this._getAtoms(a);this.$allAtoms=this.$allAtoms.add(c),b&&b(c)},insert:function(a,b){this.element.append(a);var c=this;this.addItems(a,function(a){var d=c._filter(a);c._addHideAppended(d),c._sort(),c.reLayout(),c._revealAppended(d,b)})},appended:function(a,b){var c=this;this.addItems(a,function(a){c._addHideAppended(a),c.layout(a),c._revealAppended(a,b)})},_addHideAppended:function(a){this.$filteredAtoms=this.$filteredAtoms.add(a),a.addClass("no-transition"),this._isInserting=!0,this.styleQueue.push({$el:a,style:this.options.hiddenStyle})},_revealAppended:function(a,b){var c=this;setTimeout(function(){a.removeClass("no-transition"),c.styleQueue.push({$el:a,style:c.options.visibleStyle}),c._isInserting=!1,c._processStyleQueue(a,b)},10)},reloadItems:function(){this.$allAtoms=this._getAtoms(this.element.children())},remove:function(a,b){var c=this,d=function(){c.$allAtoms=c.$allAtoms.not(a),a.remove(),b&&b.call(c.element)};a.filter(":not(."+this.options.hiddenClass+")").length?(this.styleQueue.push({$el:a,style:this.options.hiddenStyle}),this.$filteredAtoms=this.$filteredAtoms.not(a),this._sort(),this.reLayout(d)):d()},shuffle:function(a){this.updateSortData(this.$allAtoms),this.options.sortBy="random",this._sort(),this.reLayout(a)},destroy:function(){var a=this.usingTransforms,b=this.options;this.$allAtoms.removeClass(b.hiddenClass+" "+b.itemClass).each(function(){var b=this.style;b.position="",b.top="",b.left="",b.opacity="",a&&(b[i]="")});var c=this.element[0].style;for(var d in this.originalStyle)c[d]=this.originalStyle[d];this.element.unbind(".isotope").undelegate("."+b.hiddenClass,"click").removeClass(b.containerClass).removeData("isotope"),v.unbind(".isotope")},_getSegments:function(a){var b=this.options.layoutMode,c=a?"rowHeight":"columnWidth",d=a?"height":"width",e=a?"rows":"cols",g=this.element[d](),h,i=this.options[b]&&this.options[b][c]||this.$filteredAtoms["outer"+f(d)](!0)||g;h=Math.floor(g/i),h=Math.max(h,1),this[b][e]=h,this[b][c]=i},_checkIfSegmentsChanged:function(a){var b=this.options.layoutMode,c=a?"rows":"cols",d=this[b][c];return this._getSegments(a),this[b][c]!==d},_masonryReset:function(){this.masonry={},this._getSegments();var a=this.masonry.cols;this.masonry.colYs=[];while(a--)this.masonry.colYs.push(0)},_masonryLayout:function(a){var c=this,d=c.masonry;a.each(function(){var a=b(this),e=Math.ceil(a.outerWidth(!0)/d.columnWidth);e=Math.min(e,d.cols);if(e===1)c._masonryPlaceBrick(a,d.colYs);else{var f=d.cols+1-e,g=[],h,i;for(i=0;id&&(e.x=0,e.y=e.height),c._pushPosition(a,e.x,e.y),e.height=Math.max(e.y+g,e.height),e.x+=f})},_fitRowsGetContainerSize:function(){return{height:this.fitRows.height}},_fitRowsResizeChanged:function(){return!0},_cellsByRowReset:function(){this.cellsByRow={index:0},this._getSegments(),this._getSegments(!0)},_cellsByRowLayout:function(a){var c=this,d=this.cellsByRow;a.each(function(){var a=b(this),e=d.index%d.cols,f=Math.floor(d.index/d.cols),g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByRowGetContainerSize:function(){return{height:Math.ceil(this.$filteredAtoms.length/this.cellsByRow.cols)*this.cellsByRow.rowHeight+this.offset.top}},_cellsByRowResizeChanged:function(){return this._checkIfSegmentsChanged()},_straightDownReset:function(){this.straightDown={y:0}},_straightDownLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,0,c.straightDown.y),c.straightDown.y+=d.outerHeight(!0)})},_straightDownGetContainerSize:function(){return{height:this.straightDown.y}},_straightDownResizeChanged:function(){return!0},_masonryHorizontalReset:function(){this.masonryHorizontal={},this._getSegments(!0);var a=this.masonryHorizontal.rows;this.masonryHorizontal.rowXs=[];while(a--)this.masonryHorizontal.rowXs.push(0)},_masonryHorizontalLayout:function(a){var c=this,d=c.masonryHorizontal;a.each(function(){var a=b(this),e=Math.ceil(a.outerHeight(!0)/d.rowHeight);e=Math.min(e,d.rows);if(e===1)c._masonryHorizontalPlaceBrick(a,d.rowXs);else{var f=d.rows+1-e,g=[],h,i;for(i=0;id&&(e.x=e.width,e.y=0),c._pushPosition(a,e.x,e.y),e.width=Math.max(e.x+f,e.width),e.y+=g})},_fitColumnsGetContainerSize:function(){return{width:this.fitColumns.width}},_fitColumnsResizeChanged:function(){return!0},_cellsByColumnReset:function(){this.cellsByColumn={index:0},this._getSegments(),this._getSegments(!0)},_cellsByColumnLayout:function(a){var c=this,d=this.cellsByColumn;a.each(function(){var a=b(this),e=Math.floor(d.index/d.rows),f=d.index%d.rows,g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByColumnGetContainerSize:function(){return{width:Math.ceil(this.$filteredAtoms.length/this.cellsByColumn.rows)*this.cellsByColumn.columnWidth}},_cellsByColumnResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_straightAcrossReset:function(){this.straightAcross={x:0}},_straightAcrossLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,c.straightAcross.x,0),c.straightAcross.x+=d.outerWidth(!0)})},_straightAcrossGetContainerSize:function(){return{width:this.straightAcross.x}},_straightAcrossResizeChanged:function(){return!0}},b.fn.imagesLoaded=function(a){function h(){a.call(c,d)}function i(a){var c=a.target;c.src!==f&&b.inArray(c,g)===-1&&(g.push(c),--e<=0&&(setTimeout(h),d.unbind(".imagesLoaded",i)))}var c=this,d=c.find("img").add(c.filter("img")),e=d.length,f="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",g=[];return e||h(),d.bind("load.imagesLoaded error.imagesLoaded",i).each(function(){var a=this.src;this.src=f,this.src=a}),c};var w=function(b){a.console&&a.console.error(b)};b.fn.isotope=function(a,c){if(typeof a=="string"){var d=Array.prototype.slice.call(arguments,1);this.each(function(){var c=b.data(this,"isotope");if(!c){w("cannot call methods on isotope prior to initialization; attempted to call method '"+a+"'");return}if(!b.isFunction(c[a])||a.charAt(0)==="_"){w("no such method '"+a+"' for isotope instance");return}c[a].apply(c,d)})}else this.each(function(){var d=b.data(this,"isotope");d?(d.option(a),d._init(c)):b.data(this,"isotope",new b.Isotope(a,this,c))});return this}})(window,jQuery); window.addComment=function(a){function b(a){if(s&&(l=i(q.cancelReplyId),m=i(q.commentFormId),l)){l.addEventListener("touchstart",d),l.addEventListener("click",d);for(var b,f=c(a),g=0,h=f.length;g', nextText: 'Next' }); }else if(mo_options.slider_chosen==='FlexSlider'){ $('#slider-area .flexslider').flexslider({ animation: mo_options.flex_slider_effect, slideshowSpeed: parseInt(mo_options.flex_slider_pause_time, 10), animationSpeed: parseInt(mo_options.flex_slider_animation_speed, 10), pauseOnHover: toggle_of(mo_options.flex_slider_pause_on_hover), randomize: toggle_of(mo_options.flex_slider_display_random_slide), nextText: 'Next', prevText: 'Previous' }); }}); jQuery(window).load(function (){ setTimeout(function (){ jQuery('.flex-slider-container, #nivo-slider, .carousel-wrap').removeClass('loading'); }, 400); }); jQuery.noConflict(); var MO_THEME; (function ($){ "use strict"; MO_THEME={ timers: {}, wait_for_final_event: function (callback, ms, uniqueId){ if(!uniqueId){ uniqueId="Don't call this twice without a uniqueId"; } if(MO_THEME.timers[uniqueId]){ clearTimeout(MO_THEME.timers[uniqueId]); } MO_THEME.timers[uniqueId]=setTimeout(callback, ms); }, is_mobile: function (){ if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ return true; } return false; }, add_body_classes: function (){ if(MO_THEME.is_mobile()){ $('body').addClass('mobile-device'); } if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){ $('body').addClass('ios-device'); } if(navigator.userAgent.match(/Android/i)!==null){ $('body').addClass('android-device'); }}, get_internal_link: function (urlString){ var internal_link=null; if(urlString.indexOf("#")!==-1){ var arr=urlString.split('#'); if(arr.length===2){ var url=arr[0]; internal_link='#' + arr[1]; if(url===(document.URL + '/')||url===document.URL){ return internal_link; }} else if(arr.length===1){ internal_link='#' + arr[0]; return internal_link; }} return internal_link; }, init_page_navigation: function (){ $('#primary-menu > ul > li.current_page_ancestor').first().addClass('active'); $('#primary-menu > ul > li.current_page_item').first().addClass('active'); $('#primary-menu > ul > li.current-page-ancestor').first().addClass('active'); $('#primary-menu > ul > li.current-page-item').first().addClass('active'); $('#primary-menu > ul > li.current-menu-ancestor').first().addClass('active'); $('#primary-menu > ul > li.current-menu-item').first().addClass('active'); var lavaLamp=jQuery('html:not(".ie") #primary-menu > ul.menu').lavaLamp({ speed: 600 }); var delay=(function (){ var timer=0; return function (callback, ms){ clearTimeout(timer); timer=setTimeout(callback, ms); };})(); var width=$(window).width(); if(width > 768&&mo_options.sticky_menu){ $('#header').waypoint('sticky', { stuckClass: 'sticky', offset: -100, handler: function (direction){ if(direction==="up"){ $('#primary-menu > ul > li').not(".hover-bg").each(function (){ $(this).removeClass('active'); var menu_link=$(this).find('a').attr('href').replace(/\/?$/, '/'); var current_url=document.URL.replace(/\/?$/, '/'); if(menu_link===current_url){ $(this).addClass('active'); if(lavaLamp!==null){ lavaLamp.moveLava($(this)[0]); }} }); }else{ if(lavaLamp!==null){ lavaLamp.moveLava(); }} }}); $('#container').waypoint(function (){ var height=$('#header').height(); $('.sticky-wrapper').height(height); if(lavaLamp!==null){ lavaLamp.moveLava(); }}); $(window).resize(function (){ MO_THEME.wait_for_final_event(function (){ if($(document).scrollTop() < 50){ var height=$('#header').height(); $('.sticky-wrapper').height(height); }}, 200, 'sticky-wrapper-resize'); }); } if(typeof $().smoothScroll!=='undefined'){ $('#primary-menu > ul > li > a[href*="#"]').smoothScroll({easing: 'swing', speed: 700, offset: -50, excludeWithin: ['li.external']}); $('#mobile-menu a[href*="#"]').smoothScroll({easing: 'swing', speed: 700, offset: 0, excludeWithin: ['li.external']}); } $('#primary-menu > ul > li > a[href*="#"]').click(function (){ $(this).closest('ul').children('li').each(function (){ $(this).removeClass('active'); }); $(this).parent('li').addClass('active'); }); $('#primary-menu > ul > li > a[href*="#"]').each(function (){ var current_div_selector=MO_THEME.get_internal_link($(this).attr('href')); $(current_div_selector).waypoint(function (direction){ if(direction==="up"){ $('#primary-menu > ul > li').not(".hover-bg").each(function (){ $(this).removeClass('active'); if($(this).find('a').attr('href').indexOf(current_div_selector)!==-1){ $(this).addClass('active'); lavaLamp.moveLava($(this)[0]); }}); }}, { offset: function (){ var half_browser_height=$.waypoints('viewportHeight') / 2; var element_height=$(this).height(); var result=0; if(element_height > half_browser_height){ result=-(element_height - (half_browser_height)); }else{ result=-(element_height / 2); } return result; }} ); $(current_div_selector).waypoint(function (direction){ if(direction==="down"){ $('#primary-menu > ul > li').not(".hover-bg").each(function (){ $(this).removeClass('active'); if($(this).find('a').attr('href').indexOf(current_div_selector)!==-1){ $(this).addClass('active'); lavaLamp.moveLava($(this)[0]); }}); }}, { offset: '50%' }); }); }, init_menus: function (){ $('.dropdown-menu-wrap > ul').superfish({ delay: 100, animation: {height: 'show'}, speed: 'fast', autoArrows: false }); $('#mobile-menu-toggle').click(function (){ $("#mobile-menu > ul").slideToggle(500); return false; }); $("#mobile-menu ul li").each(function (){ var sub_menu=$(this).find("> ul"); if(sub_menu.length > 0&&$(this).addClass("has-ul")){ $(this).find("> a").append(''); }}); $('#mobile-menu ul li:has(">ul") > a').click(function (){ $(this).parent().toggleClass("open"); $(this).parent().find("> ul").stop(true, true).slideToggle(); return false; }); this.init_page_navigation(); }, scroll_effects: function (){ if(typeof $().waypoint==='undefined'){ return; } $("#featured-app").waypoint(function (direction){ $('#featured-app .app-screenshot').addClass('visible'); var delay=1200; $('#feature-pointers img').each(function (){ $(this).delay(delay).animate({ opacity: 1}, 200); delay=delay + 200; }); }, { offset: $.waypoints('viewportHeight') - 300, triggerOnce: true}); }, smooth_page_load_effect: function (){ $('#title-area .inner, #custom-title-area .inner, #content, .first-segment .heading2, .first-segment .heading1').css({opacity: 1}); $('.sidebar-right-nav, .sidebar-left-nav').css({opacity: 1}); }, prettyPhoto: function (){ if(typeof $().prettyPhoto==='undefined'){ return; } var theme_selected='pp_default'; $("a[rel^='prettyPhoto']").prettyPhoto({ "theme": theme_selected, social_tools: false }); }, toggle_state: function (toggle_element){ var active_class; var current_content; active_class='active-toggle'; toggle_element.siblings().removeClass(active_class); toggle_element.siblings().find('.toggle-content').slideUp("fast"); current_content=toggle_element.find('.toggle-content'); if(toggle_element.hasClass(active_class)){ toggle_element.removeClass(active_class); current_content.slideUp("fast"); }else{ toggle_element.addClass(active_class); current_content.slideDown("fast"); }}, validate_contact_form: function (){ var rules={ contact_name: { required: true, minlength: 5 }, contact_email: { required: true, email: true }, contact_phone: { required: false, minlength: 5 }, contact_url: { required: false, url: true }, human_check: { required: true, range: [13, 13] }, message: { required: true, minlength: 15 }}; var messages={ contact_name: { required: mo_theme.name_required, minlength: mo_theme.name_format }, contact_email: mo_theme.email_required, contact_url: mo_theme.url_required, contact_phone: { minlength: mo_theme.phone_required }, human_check: mo_theme.human_check_failed, message: { required: mo_theme.message_required, minlength: mo_theme.message_format }}; $("#content .contact-form").validate({ rules: rules, messages: messages, errorClass: 'form-error', submitHandler: function (theForm){ $.post(theForm.action, $(theForm).serialize(), function (response){ $("#content .feedback").html('
      ' + mo_theme.success_message + '
      '); theForm.reset(); }); }}); $(".widget .contact-form").validate({ rules: rules, messages: messages, errorClass: 'form-error', submitHandler: function (theForm){ $.post(theForm.action, $(theForm).serialize(), function (response){ $(".widget .feedback").html('
      ' + mo_theme.success_message + '
      '); theForm.reset(); }); }}); }, imageOverlay: function (){ $(".hfeed .post .image-area, .image-grid .image-area").hover(function (){ $(this).find(".image-info").fadeTo(400, 1); }, function (){ $(this).find(".image-info").fadeTo(400, 0); }); }};})(jQuery); (function ($){ "use strict"; $.fn.lavaLamp=function (o){ o=$.extend({ fx: "easeOutBack", speed: 500, click: function (){ }}, o||{}); if(this.length===0){ return null; } function setCurr(el){ hover_element.css({ left: el.offsetLeft + "px", width: el.offsetWidth + "px" }); current=el; } function move(el){ hover_element.each(function (){ $.dequeue(this, "fx"); } ).animate({ width: el.offsetWidth, left: el.offsetLeft }, o.speed, o.fx); } var me=$(this), noop=function (){ }, hover_element=$('
    5. ').appendTo(me), list_element=$(">li", this), current=$("li.active", this)[0]||$(list_element[0]).addClass("active")[0]; var delay=(function (){ var timer=0; return function (callback, ms){ clearTimeout(timer); timer=setTimeout(callback, ms); };})(); var moveLava=function (el){ if(el){ setCurr(el); }else{ hover_element.css({left: current.offsetLeft + "px", width: current.offsetWidth + "px"}); }}; if(!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))){ list_element.not(".hover-bg").hover(function (){ move(this); }, noop); $(this).hover(noop, function (){ move(current); }); } list_element.click(function (e){ setCurr(this); return o.click.apply(this, [e, this]); }); setCurr(current); $(window).resize(function (){ delay(function (){ hover_element.css({left: current.offsetLeft + "px", width: current.offsetWidth + "px"}); }, 200); }); return { moveLava: moveLava };}; })(jQuery); jQuery(document).ready(function ($){ "use strict"; MO_THEME.add_body_classes(); MO_THEME.init_menus(); $(window).scroll(function (){ MO_THEME.wait_for_final_event(function (){ var width=$(window).width(); var yPos=$(window).scrollTop(); if(width > 768&&(yPos > 200)){ if(!mo_options.disable_back_to_top){ $("#go-to-top").fadeIn(); }}else{ $("#go-to-top").fadeOut(); }}, 200, 'go-to-top'); }); $('#go-to-top').click(function (event){ event.preventDefault(); $('html, body').animate({scrollTop: 0}, 600); }); if(!mo_options.disable_animations_on_page){ MO_THEME.scroll_effects(); }else{ $('#featured-app .app-screenshot').addClass('visible'); $('#feature-pointers img').css({ opacity: 1}); } if(!mo_options.disable_smooth_page_load){ MO_THEME.smooth_page_load_effect(); } $("ul.tabs").tabs(".pane"); $(".accordion").tabs("div.pane", { tabs: 'div.tab', effect: 'slide', initialIndex: 0 }); $(".back-to-top").click(function (e){ $('html,body').animate({ scrollTop: 0 }, 600); e.preventDefault(); }); $('a.close').click(function (e){ e.preventDefault(); $(this).closest('.message-box').fadeOut(); }); $(".toggle-label").toggle(function (){ MO_THEME.toggle_state($(this).parent()); }, function (){ MO_THEME.toggle_state($(this).parent()); } ); MO_THEME.validate_contact_form(); MO_THEME.prettyPhoto(); MO_THEME.imageOverlay(); $(function (){ if(typeof $().isotope==='undefined'){ return; } var post_snippets=$('.post-snippets').not('.bx-wrapper .post-snippets'); post_snippets.imagesLoaded(function (){ post_snippets.isotope({ itemSelector: '.entry-item', layoutMode: 'fitRows' }); }); var container=$('#portfolio-items'); if(container.length===0){ return; } container.imagesLoaded(function (){ container.isotope({ itemSelector: '.portfolio-item', layoutMode: 'fitRows' }); $('#portfolio-filter a').click(function (e){ e.preventDefault(); var selector=$(this).attr('data-value'); container.isotope({ filter: selector }); return false; }); }); if(mo_options.ajax_portfolio){ if(typeof $().infinitescroll!=='undefined'&&$('.pagination').length){ container.infinitescroll({ navSelector: '.pagination', nextSelector: '.pagination .next', itemSelector: '.portfolio-item', loading: { msgText: mo_theme.loading_portfolio, finishedMsg: mo_theme.finished_loading, img: template_dir + '/images/loader.gif', selector: '#main' }}, function (newElements){ MO_THEME.imageOverlay(); var $newElems=$(newElements); $newElems.imagesLoaded(function (){ container.isotope('appended', $newElems); }); MO_THEME.prettyPhoto(); }); }} }); $("#container").fitVids(); $("#content").fitVids({ customSelector: "iframe[src^='http://maps.google.com/']"}); $("#content").fitVids({ customSelector: "iframe[src^='https://maps.google.com/']"}); if(typeof mo_options.mo_twitter_id!=='undefined'){ jQuery('#twitter').jtwt({ username: mo_options.mo_twitter_id, count: mo_options.mo_tweet_count, image_size: 32, loader_text: 'Loading Tweets' }); } var width=$(window).width(); if(width > 1100){ $.stellar({ horizontalScrolling: false, verticalOffset: 40, responsive: false }); }}); !function(a,b){"use strict";function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf("MSIE 10"),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll("iframe.wp-embedded-content");for(c=0;c1e3)g=1e3;else if(~~g<200)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}else;}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document); //fgnass.github.com/spin.js#v1.3 (function(root, factory){ if(typeof exports=='object') module.exports=factory() else if(typeof define=='function'&&define.amd) define(factory) else root.Spinner=factory() } (this, function(){ "use strict"; var prefixes=['webkit', 'Moz', 'ms', 'O'] , animations={} , useCssAnimations function createEl(tag, prop){ var el=document.createElement(tag||'div') , n for(n in prop) el[n]=prop[n] return el } function ins(parent ){ for (var i=1, n=arguments.length; i> 1):parseInt(o.left, 10) + mid) + 'px', top: (o.top=='auto' ? tp.y-ep.y + (target.offsetHeight >> 1):parseInt(o.top, 10) + mid) + 'px' }) } el.setAttribute('role', 'progressbar') self.lines(el, self.opts) if(!useCssAnimations){ var i=0 , start=(o.lines - 1) * (1 - o.direction) / 2 , alpha , fps=o.fps , f=fps/o.speed , ostep=(1-o.opacity) / (f*o.trail / 100) , astep=f/o.lines ;(function anim(){ i++; for (var j=0; j < o.lines; j++){ alpha=Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity) self.opacity(el, j * o.direction + start, alpha, o) } self.timeout=self.el&&setTimeout(anim, ~~(1000/fps)) })() } return self }, stop: function(){ var el=this.el if(el){ clearTimeout(this.timeout) if(el.parentNode) el.parentNode.removeChild(el) this.el=undefined } return this }, lines: function(el, o){ var i=0 , start=(o.lines - 1) * (1 - o.direction) / 2 , seg function fill(color, shadow){ return css(createEl(), { position: 'absolute', width: (o.length+o.width) + 'px', height: o.width + 'px', background: color, boxShadow: shadow, transformOrigin: 'left', transform: 'rotate(' + ~~(360/o.lines*i+o.rotate) + 'deg) translate(' + o.radius+'px' +',0)', borderRadius: (o.corners * o.width>>1) + 'px' }) } for (; i < o.lines; i++){ seg=css(createEl(), { position: 'absolute', top: 1+~(o.width/2) + 'px', transform: o.hwaccel ? 'translate3d(0,0,0)':'', opacity: o.opacity, animation: useCssAnimations&&addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1/o.speed + 's linear infinite' }) if(o.shadow) ins(seg, css(fill('#000', '0 0 4px ' + '#000'), {top: 2+'px'})) ins(el, ins(seg, fill(o.color, '0 0 1px rgba(0,0,0,.1)'))) } return el }, opacity: function(el, i, val){ if(i < el.childNodes.length) el.childNodes[i].style.opacity=val }}) function initVML(){ function vml(tag, attr){ return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr) } sheet.addRule('.spin-vml', 'behavior:url(#default#VML)') Spinner.prototype.lines=function(el, o){ var r=o.length+o.width , s=2*r function grp(){ return css( vml('group', { coordsize: s + ' ' + s, coordorigin: -r + ' ' + -r }), { width: s, height: s } ) } var margin=-(o.width+o.length)*2 + 'px' , g=css(grp(), {position: 'absolute', top: margin, left: margin}) , i function seg(i, dx, filter){ ins(g, ins(css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx}), ins(css(vml('roundrect', {arcsize: o.corners}), { width: r, height: o.width, left: o.radius, top: -o.width>>1, filter: filter }), vml('fill', {color: o.color, opacity: o.opacity}), vml('stroke', {opacity: 0}) ) ) ) } if(o.shadow) for (i=1; i <=o.lines; i++) seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)') for (i=1; i <=o.lines; i++) seg(i) return ins(el, g) } Spinner.prototype.opacity=function(el, i, val, o){ var c=el.firstChild o=o.shadow&&o.lines||0 if(c&&i+o < c.childNodes.length){ c=c.childNodes[i+o]; c=c&&c.firstChild; c=c&&c.firstChild if(c) c.opacity=val }} } var probe=css(createEl('group'), {behavior: 'url(#default#VML)'}) if(!vendor(probe, 'transform')&&probe.adj) initVML() else useCssAnimations=vendor(probe, 'animation') return Spinner })); (function(factory){ if(typeof exports=='object'){ factory(require('jquery'), require('spin')) } else if(typeof define=='function'&&define.amd){ define(['jquery', 'spin'], factory) }else{ if(!window.Spinner) throw new Error('Spin.js not present') factory(window.jQuery, window.Spinner) }}(function($, Spinner){ $.fn.spin=function(opts, color){ return this.each(function(){ var $this=$(this), data=$this.data(); if(data.spinner){ data.spinner.stop(); delete data.spinner; } if(opts!==false){ opts=$.extend({ color: color||$this.css('color') }, $.fn.spin.presets[opts]||opts ) if(typeof opts.right!=='undefined'&&typeof opts.length!=='undefined' && typeof opts.width!=='undefined'&&typeof opts.radius!=='undefined'){ var pad=$this.css('padding-left'); pad=(typeof pad==='undefined') ? 0:parseInt(pad, 10); opts.left=$this.outerWidth() -(2 *(opts.length + opts.width + opts.radius)) - pad - opts.right; delete opts.right; } data.spinner=new Spinner(opts).spin(this) }}) } $.fn.spin.presets={ tiny: { lines: 8, length: 2, width: 2, radius: 3 }, small: { lines: 8, length: 4, width: 3, radius: 5 }, large: { lines: 10, length: 8, width: 4, radius: 8 }} })); (function($){ $.fn.spin.presets.wp={ trail: 60, speed: 1.3 }; $.fn.spin.presets.small=$.extend({ lines: 8, length: 2, width: 2, radius: 3 }, $.fn.spin.presets.wp); $.fn.spin.presets.medium=$.extend({ lines: 8, length: 4, width: 3, radius: 5 }, $.fn.spin.presets.wp); $.fn.spin.presets.large=$.extend({ lines: 10, length: 6, width: 4, radius: 7 }, $.fn.spin.presets.wp); $.fn.spin.presets['small-left']=$.extend({ left: 5 }, $.fn.spin.presets.small); $.fn.spin.presets['small-right']=$.extend({ right: 5 }, $.fn.spin.presets.small); $.fn.spin.presets['medium-left']=$.extend({ left: 5 }, $.fn.spin.presets.medium); $.fn.spin.presets['medium-right']=$.extend({ right: 5 }, $.fn.spin.presets.medium); $.fn.spin.presets['large-left']=$.extend({ left: 5 }, $.fn.spin.presets.large); $.fn.spin.presets['large-right']=$.extend({ right: 5 }, $.fn.spin.presets.large); })(jQuery); jQuery(document).ready(function($){ var overlay, comments, gallery, container, nextButton, previousButton, info, transitionBegin, caption, resizeTimeout, photo_info, close_hint, commentInterval, lastSelectedSlide, screenPadding=110, originalOverflow=$('body').css('overflow'), originalHOverflow=$('html').css('overflow'), proportion=85, last_known_location_hash='', imageMeta, titleAndDescription, commentForm, leftColWrapper; if(window.innerWidth <=760){ screenPadding=Math.round(( window.innerWidth / 760) * 110); if(screenPadding < 40&&(( 'ontouchstart' in window)||window.DocumentTouch&&document instanceof DocumentTouch)){ screenPadding=0; }} var keyListener=function(e){ switch(e.which){ case 38: e.preventDefault(); container.scrollTop(container.scrollTop() - 100); break; case 40: e.preventDefault(); container.scrollTop(container.scrollTop() + 100); break; case 39: e.preventDefault(); gallery.jp_carousel('clearCommentTextAreaValue'); gallery.jp_carousel('next'); break; case 37: case 8: e.preventDefault(); gallery.jp_carousel('clearCommentTextAreaValue'); gallery.jp_carousel('previous'); break; case 27: e.preventDefault(); gallery.jp_carousel('clearCommentTextAreaValue'); container.jp_carousel('close'); break; default: break; }}; var resizeListener=function(){ clearTimeout(resizeTimeout); resizeTimeout=setTimeout(function(){ gallery .jp_carousel('slides') .jp_carousel('fitSlide', true); gallery.jp_carousel('updateSlidePositions', true); gallery.jp_carousel('fitMeta', true); }, 200); }; var prepareGallery=function(){ if(!overlay){ overlay=$('
      ') .addClass('jp-carousel-overlay') .css({ 'position':'absolute', 'top':0, 'right':0, 'bottom':0, 'left':0 }); var buttons=''; if(1===Number(jetpackCarouselStrings.is_logged_in)){ } buttons=$(''); caption=$('

      '); photo_info=$('').append(caption); imageMeta=$('
      ') .addClass('jp-carousel-image-meta') .css({ 'float':'right', 'margin-top':'20px', 'width':'250px' }); imageMeta .append(buttons) .append('') .append('') .append(''); titleAndDescription=$('
      ') .addClass('jp-carousel-titleanddesc') .css({ 'width':'100%', 'margin-top':imageMeta.css('margin-top') }); var commentFormMarkup=''; commentForm=$(commentFormMarkup) .css({ 'width':'100%', 'margin-top':'20px', 'color':'#999' }); comments=$('
      ') .addClass('jp-carousel-comments') .css({ 'width':'100%', 'bottom':'10px', 'margin-top':'20px' }); var commentsLoading=$('') .css({ 'width':'100%', 'bottom':'10px', 'margin-top':'20px' }); var leftWidth=($(window).width() -(screenPadding * 2)) - (imageMeta.width() + 40); leftWidth +='px'; leftColWrapper=$('
      ') .addClass('jp-carousel-left-column-wrapper') .css({ 'width':Math.floor(leftWidth) }) .append(titleAndDescription) .append(commentForm) .append(comments) .append(commentsLoading); var fadeaway=$('
      ') .addClass('jp-carousel-fadeaway'); info=$('
      ') .addClass('jp-carousel-info') .css({ 'top':Math.floor(($(window).height() / 100) * proportion), 'left':screenPadding, 'right':screenPadding }) .append(photo_info) .append(imageMeta); if(window.innerWidth <=760){ photo_info.remove().insertAfter(titleAndDescription); info.prepend(leftColWrapper); }else{ info.append(leftColWrapper); } var targetBottomPos=($(window).height() - parseInt(info.css('top'), 10)) + 'px'; nextButton=$('
      ') .addClass('jp-carousel-next-button') .css({ 'right':'15px' }); previousButton=$('
      ') .addClass('jp-carousel-previous-button') .css({ 'left':0 }); nextButton.add(previousButton).css({ 'position':'fixed', 'top':'40px', 'bottom':targetBottomPos, 'width':screenPadding }); gallery=$('
      ') .addClass('jp-carousel') .css({ 'position':'absolute', 'top':0, 'bottom':targetBottomPos, 'left':0, 'right':0 }); close_hint=$('') .css({ position:'fixed' }); container=$('
      ') .addClass('jp-carousel-wrap') .addClass('jp-carousel-transitions'); if('white'===jetpackCarouselStrings.background_color){ container.addClass('jp-carousel-light'); } container.css({ 'position':'fixed', 'top':0, 'right':0, 'bottom':0, 'left':0, 'z-index':2147483647, 'overflow-x':'hidden', 'overflow-y':'auto', 'direction':'ltr' }) .hide() .append(overlay) .append(gallery) .append(fadeaway) .append(info) .append(nextButton) .append(previousButton) .append(close_hint) .appendTo($('body')) .click(function(e){ var target=$(e.target), wrap=target.parents('div.jp-carousel-wrap'), data=wrap.data('carousel-extra'), slide=wrap.find('div.selected'), attachment_id=slide.data('attachment-id'); data=data||[]; if(target.is(gallery)||target.parents().add(target).is(close_hint)){ container.jp_carousel('close'); }else if(target.hasClass('jp-carousel-commentlink')){ e.preventDefault(); e.stopPropagation(); $(window).unbind('keydown', keyListener); container.animate({scrollTop: parseInt(info.position()['top'], 10)}, 'fast'); $('#jp-carousel-comment-form-submit-and-info-wrapper').slideDown('fast'); $('#jp-carousel-comment-form-comment-field').focus(); }else if(target.hasClass('jp-carousel-comment-login')){ var url=jetpackCarouselStrings.login_url + '%23jp-carousel-' + attachment_id; window.location.href=url; }else if(target.parents('#jp-carousel-comment-form-container').length){ var textarea=$('#jp-carousel-comment-form-comment-field') .blur(function(){ $(window).bind('keydown', keyListener); }) .focus(function(){ $(window).unbind('keydown', keyListener); }); var emailField=$('#jp-carousel-comment-form-email-field') .blur(function(){ $(window).bind('keydown', keyListener); }) .focus(function(){ $(window).unbind('keydown', keyListener); }); var authorField=$('#jp-carousel-comment-form-author-field') .blur(function(){ $(window).bind('keydown', keyListener); }) .focus(function(){ $(window).unbind('keydown', keyListener); }); var urlField=$('#jp-carousel-comment-form-url-field') .blur(function(){ $(window).bind('keydown', keyListener); }) .focus(function(){ $(window).unbind('keydown', keyListener); }); if(textarea&&textarea.attr('id')===target.attr('id')){ $(window).unbind('keydown', keyListener); $('#jp-carousel-comment-form-submit-and-info-wrapper').slideDown('fast'); }else if(target.is('input[type="submit"]')){ e.preventDefault(); e.stopPropagation(); $('#jp-carousel-comment-form-spinner').spin('small', 'white'); var ajaxData={ action: 'post_attachment_comment', nonce: jetpackCarouselStrings.nonce, blog_id: data['blog_id'], id: attachment_id, comment: textarea.val() }; if(! ajaxData['comment'].length){ gallery.jp_carousel('postCommentError', {'field': 'jp-carousel-comment-form-comment-field', 'error': jetpackCarouselStrings.no_comment_text}); return; } if(1!==Number(jetpackCarouselStrings.is_logged_in)){ ajaxData['email']=emailField.val(); ajaxData['author']=authorField.val(); ajaxData['url']=urlField.val(); if(1===Number(jetpackCarouselStrings.require_name_email)){ if(! ajaxData['email'].length||! ajaxData['email'].match('@')){ gallery.jp_carousel('postCommentError', {'field': 'jp-carousel-comment-form-email-field', 'error': jetpackCarouselStrings.no_comment_email}); return; }else if(! ajaxData['author'].length){ gallery.jp_carousel('postCommentError', {'field': 'jp-carousel-comment-form-author-field', 'error': jetpackCarouselStrings.no_comment_author}); return; }} } $.ajax({ type: 'POST', url: jetpackCarouselStrings.ajaxurl, data: ajaxData, dataType: 'json', success: function(response){ if('approved'===response.comment_status){ $('#jp-carousel-comment-post-results').slideUp('fast').html('').slideDown('fast'); }else if('unapproved'===response.comment_status){ $('#jp-carousel-comment-post-results').slideUp('fast').html('').slideDown('fast'); }else{ $('#jp-carousel-comment-post-results').slideUp('fast').html('').slideDown('fast'); } gallery.jp_carousel('clearCommentTextAreaValue'); gallery.jp_carousel('getComments', {attachment_id: attachment_id, offset: 0, clear: true}); $('#jp-carousel-comment-form-button-submit').val(jetpackCarouselStrings.post_comment); $('#jp-carousel-comment-form-spinner').spin(false); }, error: function(){ gallery.jp_carousel('postCommentError', {'field': 'jp-carousel-comment-form-comment-field', 'error': jetpackCarouselStrings.comment_post_error}); return; }}); }}else if(! target.parents('.jp-carousel-info').length){ container.jp_carousel('next'); }}) .bind('jp_carousel.afterOpen', function(){ $(window).bind('keydown', keyListener); $(window).bind('resize', resizeListener); gallery.opened=true; resizeListener(); }) .bind('jp_carousel.beforeClose', function(){ var scroll=$(window).scrollTop(); $(window).unbind('keydown', keyListener); $(window).unbind('resize', resizeListener); $(window).scrollTop(scroll); }) .bind('jp_carousel.afterClose', function(){ if(history.pushState){ history.pushState('', document.title, window.location.pathname + window.location.search); }else{ last_known_location_hash=''; window.location.hash=''; } gallery.opened=false; }) .on('transitionend.jp-carousel ', '.jp-carousel-slide', function(e){ if('transform'===e.originalEvent.propertyName){ var transitionMultiplier=(( Date.now() - transitionBegin) / 1000) / e.originalEvent.elapsedTime; container.off('transitionend.jp-carousel'); if(transitionMultiplier >=2){ $('.jp-carousel-transitions').removeClass('jp-carousel-transitions'); }} }); $('.jp-carousel-wrap').touchwipe({ wipeLeft:function(e){ e.preventDefault(); gallery.jp_carousel('next'); }, wipeRight:function(e){ e.preventDefault(); gallery.jp_carousel('previous'); }, preventDefaultEvents:false }); $('.jetpack-likes-widget-unloaded').each(function(){ jetpackLikesWidgetQueue.push(this.id); }); nextButton.add(previousButton).click(function(e){ e.preventDefault(); e.stopPropagation(); if(nextButton.is(this)){ gallery.jp_carousel('next'); }else{ gallery.jp_carousel('previous'); }}); }}; var methods={ testForData: function(gallery){ gallery=$(gallery); return !(! gallery.length||! gallery.data('carousel-extra')); }, testIfOpened: function(){ return !!('undefined'!==typeof(gallery)&&'undefined'!==typeof(gallery.opened)&&gallery.opened); }, openOrSelectSlide: function(index){ if(! $(this).jp_carousel('testIfOpened')){ $(this).jp_carousel('open', { start_index: index }); }else{ gallery.jp_carousel('selectSlideAtIndex', index); }}, open: function(options){ var settings={ 'items_selector':'.gallery-item [data-attachment-id], .tiled-gallery-item [data-attachment-id]', 'start_index': 0 }, data=$(this).data('carousel-extra'); if(!data){ return; } prepareGallery(data); if(gallery.jp_carousel('testIfOpened')){ return; } originalOverflow=$('body').css('overflow'); $('body').css('overflow', 'hidden'); originalHOverflow=$('html').css('overflow'); $('html').css('overflow', 'hidden'); jQuery('.slim-likes-widget').find('iframe').css('display', 'inline-block').css('width', '60px'); container.data('carousel-extra', data); return this.each(function(){ var $this=$(this); if(options){ $.extend(settings, options); } if(-1===settings.start_index){ settings.start_index=0; } container.trigger('jp_carousel.beforeOpen').fadeIn('fast',function(){ container.trigger('jp_carousel.afterOpen'); gallery .jp_carousel('initSlides', $this.find(settings.items_selector), settings.start_index) .jp_carousel('selectSlideAtIndex', settings.start_index); }); gallery.html(''); }); }, selectSlideAtIndex:function(index){ var slides=this.jp_carousel('slides'), selected=slides.eq(index); if(0===selected.length){ selected=slides.eq(0); } gallery.jp_carousel('selectSlide', selected, false); return this; }, close:function(){ $('body').css('overflow', originalOverflow); $('html').css('overflow', originalHOverflow); return container .trigger('jp_carousel.beforeClose') .fadeOut('fast', function(){ container.trigger('jp_carousel.afterClose'); }); }, next:function(){ var slide=gallery.jp_carousel('nextSlide'); container.animate({scrollTop:0}, 'fast'); if(slide){ this.jp_carousel('selectSlide', slide); }}, previous:function(){ var slide=gallery.jp_carousel('prevSlide'); container.animate({scrollTop:0}, 'fast'); if(slide){ this.jp_carousel('selectSlide', slide); }}, resetButtons:function(current){ if(current.data('liked')){ $('.jp-carousel-buttons a.jp-carousel-like').addClass('liked').text(jetpackCarouselStrings.unlike); }else{ $('.jp-carousel-buttons a.jp-carousel-like').removeClass('liked').text(jetpackCarouselStrings.like); }}, selectedSlide:function(){ return this.find('.selected'); }, setSlidePosition:function(x){ transitionBegin=Date.now(); return this.css({ '-webkit-transform':'translate3d(' + x + 'px,0,0)', '-moz-transform':'translate3d(' + x + 'px,0,0)', '-ms-transform':'translate(' + x + 'px,0)', '-o-transform':'translate(' + x + 'px,0)', 'transform':'translate3d(' + x + 'px,0,0)' }); }, updateSlidePositions:function(animate){ var current=this.jp_carousel('selectedSlide'), galleryWidth=gallery.width(), currentWidth=current.width(), previous=gallery.jp_carousel('prevSlide'), next=gallery.jp_carousel('nextSlide'), previousPrevious=previous.prev(), nextNext=next.next(), left=Math.floor(( galleryWidth - currentWidth) * 0.5); current.jp_carousel('setSlidePosition', left).show(); gallery.jp_carousel('fitInfo', animate); var direction=lastSelectedSlide.is(current.prevAll()) ? 1:-1; if(1===direction){ if(! nextNext.is(previous)){ nextNext.jp_carousel('setSlidePosition', galleryWidth + next.width()).show(); } if(! previousPrevious.is(next)){ previousPrevious.jp_carousel('setSlidePosition', -previousPrevious.width() - currentWidth).show(); }}else{ if(! nextNext.is(previous)){ nextNext.jp_carousel('setSlidePosition', galleryWidth + currentWidth).show(); }} previous.jp_carousel('setSlidePosition', Math.floor(-previous.width() +(screenPadding * 0.75))).show(); next.jp_carousel('setSlidePosition', Math.ceil(galleryWidth -(screenPadding * 0.75))).show(); }, selectSlide:function(slide, animate){ lastSelectedSlide=this.find('.selected').removeClass('selected'); var slides=gallery.jp_carousel('slides').css({ 'position': 'fixed' }), current=$(slide).addClass('selected').css({ 'position': 'relative' }), attachmentId=current.data('attachment-id'), previous=gallery.jp_carousel('prevSlide'), next=gallery.jp_carousel('nextSlide'), previousPrevious=previous.prev(), nextNext=next.next(), animated, captionHtml; gallery.jp_carousel('loadFullImage', current); caption.hide(); if(next.length===0&&slides.length <=2){ $('.jp-carousel-next-button').hide(); }else{ $('.jp-carousel-next-button').show(); } if(previous.length===0&&slides.length <=2){ $('.jp-carousel-previous-button').hide(); }else{ $('.jp-carousel-previous-button').show(); } animated=current .add(previous) .add(previousPrevious) .add(next) .add(nextNext) .jp_carousel('loadSlide'); slides.not(animated).hide(); gallery.jp_carousel('updateSlidePositions', animate); gallery.jp_carousel('resetButtons', current); container.trigger('jp_carousel.selectSlide', [current]); gallery.jp_carousel('getTitleDesc', { title: current.data('title'), desc: current.data('desc') }); gallery.jp_carousel('loadLikes', attachmentId); gallery.jp_carousel('updateLikesWidgetVisibility', attachmentId); if(next.length > 0){ gallery.jp_carousel('loadLikes', next.data('attachment-id')); } if(previous.length > 0){ gallery.jp_carousel('loadLikes', previous.data('attachment-id')); } var imageMeta=current.data('image-meta'); gallery.jp_carousel('updateExif', imageMeta); gallery.jp_carousel('updateFullSizeLink', current); gallery.jp_carousel('updateMap', imageMeta); gallery.jp_carousel('testCommentsOpened', current.data('comments-opened')); gallery.jp_carousel('getComments', { 'attachment_id': attachmentId, 'offset': 0, 'clear': true }); $('#jp-carousel-comment-post-results').slideUp(); if(current.data('caption')){ captionHtml=$('
      ').text(current.data('caption')).html(); if(captionHtml===$('
      ').text(current.data('title')).html()){ $('.jp-carousel-titleanddesc-title').fadeOut('fast').empty(); } if(captionHtml===$('
      ').text(current.data('desc')).html()){ $('.jp-carousel-titleanddesc-desc').fadeOut('fast').empty(); } caption.html(current.data('caption')).fadeIn('slow'); }else{ caption.fadeOut('fast').empty(); } $(next).add(previous).each(function(){ gallery.jp_carousel('loadFullImage', $(this)); }); window.location.hash=last_known_location_hash='#jp-carousel-' + attachmentId; }, slides:function(){ return this.find('.jp-carousel-slide'); }, slideDimensions:function(){ return { width: $(window).width() - (screenPadding * 2), height: Math.floor($(window).height() / 100 * proportion - 60) };}, loadSlide:function(){ return this.each(function(){ var slide=$(this); slide.find('img') .one('load', function(){ slide .jp_carousel('fitSlide',false); }); }); }, bestFit:function(){ var max=gallery.jp_carousel('slideDimensions'), orig=this.jp_carousel('originalDimensions'), orig_ratio=orig.width / orig.height, w_ratio=1, h_ratio=1, width, height; if(orig.width > max.width){ w_ratio=max.width / orig.width; } if(orig.height > max.height){ h_ratio=max.height / orig.height; } if(w_ratio < h_ratio){ width=max.width; height=Math.floor(width / orig_ratio); }else if(h_ratio < w_ratio){ height=max.height; width=Math.floor(height * orig_ratio); }else{ width=orig.width; height=orig.height; } return { width: width, height: height };}, fitInfo:function(){ var current=this.jp_carousel('selectedSlide'), size=current.jp_carousel('bestFit'); photo_info.css({ 'left':Math.floor((info.width() - size.width) * 0.5), 'width':Math.floor(size.width) }); return this; }, fitMeta:function(animated){ var newInfoTop={ top: Math.floor($(window).height() / 100 * proportion + 5) + 'px' }; var newLeftWidth={ width:(info.width() - (imageMeta.width() + 80)) + 'px' }; if(animated){ info.animate(newInfoTop); leftColWrapper.animate(newLeftWidth); }else{ info.animate(newInfoTop); leftColWrapper.css(newLeftWidth); }}, fitSlide:function(){ return this.each(function(){ var $this=$(this), dimensions=$this.jp_carousel('bestFit'), method='css', max=gallery.jp_carousel('slideDimensions'); dimensions.left=0; dimensions.top=Math.floor((max.height - dimensions.height) * 0.5) + 40; $this[method](dimensions); }); }, texturize:function(text){ text='' + text; // make sure we get a string. Title "1" came in as int 1, for example, which did not support .replace(). text=text.replace(/'/g, '’').replace(/'/g, '’').replace(/[\u2019]/g, '’'); text=text.replace(/"/g, '”').replace(/"/g, '”').replace(/"/g, '”').replace(/[\u201D]/g, '”'); text=text.replace(/([\w]+)=&#[\d]+;(.+?)&#[\d]+;/g, '$1="$2"'); return $.trim(text); }, initSlides:function(items, start_index){ if(items.length < 2){ $('.jp-carousel-next-button, .jp-carousel-previous-button').hide(); }else{ $('.jp-carousel-next-button, .jp-carousel-previous-button').show(); } items.each(function(){ var src_item=$(this), orig_size=src_item.data('orig-size')||'', max=gallery.jp_carousel('slideDimensions'), parts=orig_size.split(','), medium_file=src_item.data('medium-file')||'', large_file=src_item.data('large-file')||'', src; orig_size={width: parseInt(parts[0], 10), height: parseInt(parts[1], 10)}; src=src_item.data('orig-file'); src=gallery.jp_carousel('selectBestImageSize', { orig_file:src, orig_width:orig_size.width, orig_height:orig_size.height, max_width:max.width, max_height:max.height, medium_file:medium_file, large_file:large_file }); $(this).data('gallery-src', src); }); if(0!==start_index){ $('')[0].src=$(items[start_index]).data('gallery-src'); } var useInPageThumbnails=items.first().closest('.tiled-gallery.type-rectangular').length > 0; items.each(function(i){ var src_item=$(this), attachment_id=src_item.data('attachment-id')||0, comments_opened=src_item.data('comments-opened')||0, image_meta=src_item.data('image-meta')||{}, orig_size=src_item.data('orig-size')||'', thumb_size={ width:src_item[0].naturalWidth, height:src_item[0].naturalHeight }, title=src_item.data('image-title')||'', description=src_item.data('image-description')||'', caption=src_item.parents('.gallery-item').find('.gallery-caption').html()||'', src=src_item.data('gallery-src')||'', medium_file=src_item.data('medium-file')||'', large_file=src_item.data('large-file')||'', orig_file=src_item.data('orig-file')||''; var tiledCaption=src_item.parents('div.tiled-gallery-item').find('div.tiled-gallery-caption').html(); if(tiledCaption){ caption=tiledCaption; } if(attachment_id&&orig_size.length){ title=gallery.jp_carousel('texturize', title); description=gallery.jp_carousel('texturize', description); caption=gallery.jp_carousel('texturize', caption); var image=$('') .attr('src', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7') .css('width', '100%') .css('height', '100%'); var slide=$('') .hide() .css({ 'left':i < start_index ? -1000:gallery.width() }) .append(image) .appendTo(gallery) .data('src', src) .data('title', title) .data('desc', description) .data('caption', caption) .data('attachment-id', attachment_id) .data('permalink', src_item.parents('a').attr('href')) .data('orig-size', orig_size) .data('comments-opened', comments_opened) .data('image-meta', image_meta) .data('medium-file', medium_file) .data('large-file', large_file) .data('orig-file', orig_file) .data('thumb-size', thumb_size) ; if(useInPageThumbnails){ slide .data('preview-image', src_item.attr('src')) .css({ 'background-image':'url("' + src_item.attr('src') + '")', 'background-size':'100% 100%', 'background-position':'center center' }); } slide.jp_carousel('fitSlide', false); }}); return this; }, selectBestImageSize: function(args){ if('object'!==typeof args){ args={};} if('undefined'===typeof args.orig_file){ return ''; } if('undefined'===typeof args.orig_width||'undefined'===typeof args.max_width){ return args.orig_file; } if('undefined'===typeof args.medium_file||'undefined'===typeof args.large_file){ return args.orig_file; } var medium_size=args.medium_file.replace(/-([\d]+x[\d]+)\..+$/, '$1'), medium_size_parts=(medium_size!==args.medium_file) ? medium_size.split('x'):[args.orig_width, 0], medium_width=parseInt(medium_size_parts[0], 10), medium_height=parseInt(medium_size_parts[1], 10), large_size=args.large_file.replace(/-([\d]+x[\d]+)\..+$/, '$1'), large_size_parts=(large_size!==args.large_file) ? large_size.split('x'):[args.orig_width, 0], large_width=parseInt(large_size_parts[0], 10), large_height=parseInt(large_size_parts[1], 10); if('undefined'!==typeof window.devicePixelRatio&&window.devicePixelRatio > 1){ args.max_width=args.max_width * window.devicePixelRatio; args.max_height=args.max_height * window.devicePixelRatio; } if(large_width >=args.max_width||large_height >=args.max_height){ return args.large_file; } if(medium_width >=args.max_width||medium_height >=args.max_height){ return args.medium_file; } return args.orig_file; }, originalDimensions: function(){ var splitted=$(this).data('orig-size').split(','); return {width: parseInt(splitted[0], 10), height: parseInt(splitted[1], 10)};}, format: function(args){ if('object'!==typeof args){ args={};} if(! args.text||'undefined'===typeof args.text){ return; } if(! args.replacements||'undefined'===typeof args.replacements){ return args.text; } return args.text.replace(/{(\d+)}/g, function(match, number){ return typeof args.replacements[number]!=='undefined' ? args.replacements[number]:match; }); }, shutterSpeed: function(d){ if(d >=1){ return Math.round(d*10)/10 + 's'; } var df=1, top=1, bot=1; var tol=1e-8; while (df!==d&&Math.abs(df-d) > tol){ if(df < d){ top +=1; }else{ bot +=1; top=parseInt(d * bot, 10); } df=top / bot; } if(top > 1){ bot=Math.round(bot / top); top=1; } if(bot <=1){ return '1s'; } return top + '/' + bot + 's'; }, parseTitleDesc: function(value){ if(!value.match(' ')&&value.match('_')){ return ''; } $([ 'CIMG', 'DSC_', 'DSCF', 'DSCN', 'DUW', 'GEDC', 'IMG', 'JD', 'MGP', 'PICT', 'Imagen', 'Foto', 'DSC', 'Scan', 'SANY', 'SAM', 'Screen Shot [0-9]+' ]) .each(function(key, val){ var regex=new RegExp('^' + val); if(regex.test(value)){ value=''; return; }}); return value; }, getTitleDesc: function(data){ var title='', desc='', markup='', target; target=$('div.jp-carousel-titleanddesc', 'div.jp-carousel-wrap'); target.hide(); title=gallery.jp_carousel('parseTitleDesc', data.title)||''; desc=gallery.jp_carousel('parseTitleDesc', data.desc)||''; if(title.length||desc.length){ if($('
      ').text(title).html()===$('
      ').text(desc).html()){ title=''; } markup=(title.length) ? '':''; markup +=(desc.length) ? '':''; target.html(markup).fadeIn('slow'); } $('div#jp-carousel-comment-form-container').css('margin-top', '20px'); $('div#jp-carousel-comments-loading').css('margin-top', '20px'); }, updateLikesWidgetVisibility: function(attachmentId){ if('undefined'===typeof jetpackLikesWidgetQueue){ return; } $('.jp-carousel-buttons .jetpack-likes-widget-wrapper').css('display', 'none').each(function (){ var widgetWrapper=$(this); if(widgetWrapper.attr('data-attachment-id')==attachmentId){ widgetWrapper.css('display', 'inline-block'); return false; }}); }, loadLikes:function(attachmentId){ var dataCarouselExtra=$('.jp-carousel-wrap').data('carousel-extra'); var blogId=dataCarouselExtra.likes_blog_id; if($('#like-post-wrapper-' + blogId + '-' + attachmentId).length===0){ var protocol='http'; var originDomain='http://wordpress.com'; if(dataCarouselExtra.permalink.length){ protocol=dataCarouselExtra.permalink.split(':')[0]; if(( protocol!=='http')&&(protocol!=='https')){ protocol='http'; } var parts=dataCarouselExtra.permalink.split('/'); if(parts.length >=2){ originDomain=protocol + '://' + parts[2]; }} var dataSource=protocol + '://widgets.wp.com/likes/#blog_id=' + encodeURIComponent(blogId) + '&post_id=' + encodeURIComponent(attachmentId) + '&slim=1&origin=' + encodeURIComponent(originDomain); if('en'!==jetpackCarouselStrings.lang){ dataSource +='&lang=' + encodeURIComponent(jetpackCarouselStrings.lang); } var likesWidget=$('') .attr('name', 'like-post-frame-' + blogId + '-' + attachmentId) .attr('src', dataSource) .css('display', 'inline-block'); var likesWidgetWrapper=$('
      ') .addClass('jetpack-likes-widget-wrapper jetpack-likes-widget-unloaded slim-likes-widget') .attr('id', 'like-post-wrapper-' + blogId + '-' + attachmentId) .attr('data-src', dataSource) .attr('data-name', 'like-post-frame-' + blogId + '-' + attachmentId) .attr('data-attachment-id', attachmentId) .css('display', 'none') .css('vertical-align', 'middle') .append(likesWidget) .append('
      '); $('.jp-carousel-buttons').append(likesWidgetWrapper); }}, updateExif: function(meta){ if(!meta||1!==Number(jetpackCarouselStrings.display_exif)){ return false; } var $ul=$(''); $.each(meta, function(key, val){ if(0===parseFloat(val)||!val.length||-1===$.inArray(key, [ 'camera', 'aperture', 'shutter_speed', 'focal_length' ])){ return; } switch(key){ case 'focal_length': val=val + 'mm'; break; case 'shutter_speed': val=gallery.jp_carousel('shutterSpeed', val); break; case 'aperture': val='f/' + val; break; } $ul.append('
    6. ' + jetpackCarouselStrings[key] + '
      ' + val + '
    7. '); }); $('div.jp-carousel-image-meta ul.jp-carousel-image-exif').replaceWith($ul); }, updateFullSizeLink: function(current){ if(!current||!current.data){ return false; } var original=current.data('orig-file').replace(/\?.+$/, ''), origSize=current.data('orig-size').split(','), permalink=$(''+gallery.jp_carousel('format', {'text': jetpackCarouselStrings.download_original, 'replacements': origSize})+'') .addClass('jp-carousel-image-download') .attr('href', original) .attr('target', '_blank'); $('div.jp-carousel-image-meta a.jp-carousel-image-download').replaceWith(permalink); }, updateMap: function(meta){ if(!meta.latitude||!meta.longitude||1!==Number(jetpackCarouselStrings.display_geo)){ return; } var latitude=meta.latitude, longitude=meta.longitude, $metabox=$('div.jp-carousel-image-meta', 'div.jp-carousel-wrap'), $mapbox=$('
      '), style='&scale=2&style=feature:all|element:all|invert_lightness:true|hue:0x0077FF|saturation:-50|lightness:-5|gamma:0.91'; $mapbox .addClass('jp-carousel-image-map') .html('\ \
      \ \ ') .prependTo($metabox); }, testCommentsOpened: function(opened){ if(1===parseInt(opened, 10)){ $('.jp-carousel-buttons').fadeIn('fast'); commentForm.fadeIn('fast'); }else{ $('.jp-carousel-buttons').fadeOut('fast'); commentForm.fadeOut('fast'); }}, getComments: function(args){ clearInterval(commentInterval); if('object'!==typeof args){ return; } if('undefined'===typeof args.attachment_id||! args.attachment_id){ return; } if(! args.offset||'undefined'===typeof args.offset||args.offset < 1){ args.offset=0; } var comments=$('.jp-carousel-comments'), commentsLoading=$('#jp-carousel-comments-loading').show(); if(args.clear){ comments.hide().empty(); } $.ajax({ type: 'GET', url: jetpackCarouselStrings.ajaxurl, dataType: 'json', data: { action: 'get_attachment_comments', nonce: jetpackCarouselStrings.nonce, id: args.attachment_id, offset: args.offset }, success: function(data){ if(args.clear){ comments.fadeOut('fast').empty(); } $(data).each(function(){ var comment=$('
      ') .addClass('jp-carousel-comment') .attr('id', 'jp-carousel-comment-' + this['id']) .html('
      ' + this['gravatar_markup'] + '
      ' + '
      ' + this['author_markup'] + '
      ' + '
      ' + this['date_gmt'] + '
      ' + '
      ' + this['content'] + '
      ' ); comments.append(comment); clearInterval(commentInterval); commentInterval=setInterval(function(){ if(( $('.jp-carousel-overlay').height() - 150) < $('.jp-carousel-wrap').scrollTop() + $(window).height()){ gallery.jp_carousel('getComments',{ attachment_id: args.attachment_id, offset: args.offset + 10, clear: false }); clearInterval(commentInterval); }}, 300); }); var current=$('.jp-carousel div.selected'); if(current&¤t.data&¤t.data('attachment-id')!=args.attachment_id){ comments.fadeOut('fast'); comments.empty(); return; } $('.jp-carousel-overlay').height($(window).height() + titleAndDescription.height() + commentForm.height() +((comments.height() > 0) ? comments.height():imageMeta.height()) + 200); comments.show(); commentsLoading.hide(); }, error: function(xhr, status, error){ console.log('Comment get fail...', xhr, status, error); comments.fadeIn('fast'); commentsLoading.fadeOut('fast'); }}); }, postCommentError: function(args){ if('object'!==typeof args){ args={};} if(! args.field||'undefined'===typeof args.field||! args.error||'undefined'===typeof args.error){ return; } $('#jp-carousel-comment-post-results').slideUp('fast').html('').slideDown('fast'); $('#jp-carousel-comment-form-spinner').spin(false); }, setCommentIframeSrc: function(attachment_id){ var iframe=$('#jp-carousel-comment-iframe'); if(iframe&&iframe.length){ iframe.attr('src', iframe.attr('src').replace(/(postid=)\d+/, '$1'+attachment_id)); iframe.attr('src', iframe.attr('src').replace(/(%23.+)?$/, '%23jp-carousel-'+attachment_id)); }}, clearCommentTextAreaValue: function(){ var commentTextArea=$('#jp-carousel-comment-form-comment-field'); if(commentTextArea){ commentTextArea.val(''); }}, nextSlide:function (){ var slides=this.jp_carousel('slides'); var selected=this.jp_carousel('selectedSlide'); if(selected.length===0||(slides.length > 2&&selected.is(slides.last()))){ return slides.first(); } return selected.next(); }, prevSlide:function (){ var slides=this.jp_carousel('slides'); var selected=this.jp_carousel('selectedSlide'); if(selected.length===0||(slides.length > 2&&selected.is(slides.first()))){ return slides.last(); } return selected.prev(); }, loadFullImage:function(slide){ var image=slide.find('img:first'); if(! image.data('loaded')){ image.on('load.jetpack', function (){ image.off('load.jetpack'); $(this).closest('.jp-carousel-slide').css('background-image', ''); }); if(! slide.data('preview-image')||(slide.data('thumb-size')&&slide.width() > slide.data('thumb-size').width)){ image.attr('src', image.closest('.jp-carousel-slide').data('src')); }else{ image.attr('src', slide.data('preview-image')); } image.data('loaded', 1); }} }; $.fn.jp_carousel=function(method){ if(methods[method]){ return methods[ method ].apply(this, Array.prototype.slice.call(arguments, 1)); }else if(typeof method==='object'||! method){ return methods.open.apply(this, arguments); }else{ $.error('Method ' + method + ' does not exist on jQuery.jp_carousel'); }}; $(document.body).on('click', 'div.gallery,div.tiled-gallery', function(e){ if(! $(this).jp_carousel('testForData', e.currentTarget)){ return; } if($(e.target).parent().hasClass('gallery-caption')){ return; } e.preventDefault(); $(this).jp_carousel('open', {start_index: $(this).find('.gallery-item, .tiled-gallery-item').index($(e.target).parents('.gallery-item, .tiled-gallery-item'))}); }); $(window).on('hashchange', function (){ var hashRegExp=/jp-carousel-(\d+)/, matches, attachmentId, galleries, selectedThumbnail; if(! window.location.hash||! hashRegExp.test(window.location.hash)){ return; } if(window.location.hash===last_known_location_hash){ return; } last_known_location_hash=window.location.hash; matches=window.location.hash.match(hashRegExp); attachmentId=parseInt(matches[1], 10); galleries=$('div.gallery, div.tiled-gallery'); galleries.each(function(_, galleryEl){ $(galleryEl).find('img').each(function(imageIndex, imageEl){ if($(imageEl).data('attachment-id')===parseInt(attachmentId, 10)){ selectedThumbnail={ index: imageIndex, gallery: galleryEl }; return false; }}); if(selectedThumbnail){ $(selectedThumbnail.gallery) .jp_carousel('openOrSelectSlide', selectedThumbnail.index); }}); }); if(window.location.hash){ $(window).trigger('hashchange'); }}); (function($){ $.fn.touchwipe=function(settings){ var config={ min_move_x: 20, min_move_y: 20, wipeLeft: function(){ }, wipeRight: function(){ }, wipeUp: function(){ }, wipeDown: function(){ }, preventDefaultEvents: true }; if(settings){ $.extend(config, settings); } this.each(function(){ var startX; var startY; var isMoving=false; function cancelTouch(){ this.removeEventListener('touchmove', onTouchMove); startX=null; isMoving=false; } function onTouchMove(e){ if(config.preventDefaultEvents){ e.preventDefault(); } if(isMoving){ var x=e.touches[0].pageX; var y=e.touches[0].pageY; var dx=startX - x; var dy=startY - y; if(Math.abs(dx) >=config.min_move_x){ cancelTouch(); if(dx > 0){ config.wipeLeft(e); }else{ config.wipeRight(e); }} else if(Math.abs(dy) >=config.min_move_y){ cancelTouch(); if(dy > 0){ config.wipeDown(e); }else{ config.wipeUp(e); }} }} function onTouchStart(e){ if(e.touches.length===1){ startX=e.touches[0].pageX; startY=e.touches[0].pageY; isMoving=true; this.addEventListener('touchmove', onTouchMove, false); }} if('ontouchstart' in document.documentElement){ this.addEventListener('touchstart', onTouchStart, false); }}); return this; };})(jQuery);